ParameterNotFoundException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 3
1
<?php
2
3
namespace Aidphp\Di;
4
5
use InvalidArgumentException;
6
use Psr\Container\NotFoundExceptionInterface;
7
use ReflectionParameter;
8
use Throwable;
9
10
class ParameterNotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
11
{
12 2
    public function __construct(ReflectionParameter $param, Throwable $previous = null)
13
    {
14 2
        $msg = 'Unable to resolve the parameter ' . ($param->getPosition() + 1) . ' named $' . $param->name . ($param->hasType() ? ' of type ' . $param->getType() : '') .
15 2
        ' in ' . (null !== ($class = $param->getDeclaringClass()) ? $class->name . '::' : '') . $param->getDeclaringFunction()->name . '()';
16
17 2
        parent::__construct($msg, 0, $previous);
18
    }
19
}