Passed
Push — master ( 3ad7fe...719238 )
by Alexander
01:23
created

ArgumentException   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Injector;
6
7
abstract class ArgumentException extends \InvalidArgumentException
8
{
9
    protected const EXCEPTION_MESSAGE = 'Something is wrong with argument "%s" when calling "%s".';
10
11 9
    public function __construct(\ReflectionFunctionAbstract $reflection, string $parameter)
12
    {
13 9
        $function = $reflection->getName();
14 9
        $class = $reflection->class ?? null;
15 9
        $method = $class !== null ? "{$class}::{$function}" : $function;
16
17 9
        parent::__construct(sprintf(static::EXCEPTION_MESSAGE, $parameter, $method));
18
    }
19
}
20