0 follower

Abstract Class Yiisoft\Injector\ArgumentException

InheritanceYiisoft\Injector\ArgumentException » InvalidArgumentException
SubclassesYiisoft\Injector\InvalidArgumentException, Yiisoft\Injector\MissingInternalArgumentException, Yiisoft\Injector\MissingRequiredArgumentException

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Injector\ArgumentException

Constants

Hide inherited constants

Constant Value Description Defined By
EXCEPTION_MESSAGE 'Something is wrong with argument "%s" when calling "%s"%s.' Yiisoft\Injector\ArgumentException

Method Details

Hide inherited methods

__construct() public method

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));
}