Completed
Push — sam-rework ( 7a8255...f8da6f )
by Andrii
12:42
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
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\di\definitions;
9
10
use Psr\Container\ContainerInterface;
11
use yii\di\contracts\DefinitionInterface;
12
use yii\di\exceptions\NotFoundException;
13
14
/**
15
 * An invalid dependency is created when a parameter has no type and no default value.
16
 * For example:
17
 * ```php
18
 * public function __construct($a, $b) {}
19
 * ```
20
 *
21
 * These dependency must be replaced, attempting to resolve them will throw an exception
22
 */
23
class InvalidDefinition implements DefinitionInterface
24
{
25
    public function resolve(ContainerInterface $container, array $params = [])
26
    {
27
        throw new NotFoundException('Invalid reference');
28
    }
29
}
30