Abstract Class Yiisoft\Injector\ArgumentException
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Injector\ArgumentException |
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| EXCEPTION_MESSAGE | 'Something is wrong with argument "%s" when calling "%s"%s.' | Yiisoft\Injector\ArgumentException |
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.