Final Class Yiisoft\Injector\InvalidArgumentException
| Inheritance | Yiisoft\Injector\InvalidArgumentException » Yiisoft\Injector\ArgumentException » InvalidArgumentException |
|---|
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Injector\ArgumentException |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| EXCEPTION_MESSAGE | 'Invalid argument "%s" when calling "%s"%s. Non-interface argument should be' . ' named explicitly when passed.' | Yiisoft\Injector\InvalidArgumentException |
Method Details
| public mixed __construct ( ReflectionFunctionAbstract $reflection, string $parameter ) | ||
| $reflection | ReflectionFunctionAbstract | |
| $parameter | string | |
public function __construct(ReflectionFunctionAbstract $reflection, string $parameter)
{
$function = $reflection->getName();
/** @psalm-var class-string|null $class */
$class = $reflection->class ?? null;
if ($class === null) {
$method = $function;
if (strpos($method, '{closure') !== false) {
$method = $this->renderClosureSignature($reflection);
}
} else {
$method = "{$class}::{$function}";
}
$fileName = $reflection->getFileName();
$line = $reflection->getStartLine();
$fileAndLine = '';
if (!empty($fileName)) {
$fileAndLine = " in \"$fileName\" at line $line";
}
parent::__construct(sprintf(static::EXCEPTION_MESSAGE, $parameter, $method, $fileAndLine));
}
Signup or Login in order to comment.