Completed
Push — master ( b0867d...8ab030 )
by Alexander
24s queued 11s
created

InvalidDefinition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 2
dl 0
loc 5
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 3 1
1
<?php
2
namespace yii\di\definitions;
3
4
use Psr\Container\ContainerInterface;
5
use yii\di\contracts\Definition;
6
use yii\di\exceptions\NotFoundException;
7
8
/**
9
 * An invalid dependency is created when a parameter has no type and no default value.
10
 * For example:
11
 * ```php
12
 * public function __construct($a, $b) {}
13
 * ```
14
 *
15
 * These dependency must be replaced, attempting to resolve them will throw an exception
16
 */
17
class InvalidDefinition implements Definition
18
{
19
    public function resolve(ContainerInterface $container, array $params = [])
20
    {
21
        throw new NotFoundException('Invalid reference');
22
    }
23
}
24