Completed
Push — sam-rework ( 7a8255...f8da6f )
by Andrii
12:42
created

InvalidDefinition::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
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