Completed
Push — sam-rework ( 1696e6 )
by Andrii
38:13 queued 23:11
created

InvalidDependency::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 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\dependencies;
9
10
use Psr\Container\ContainerInterface;
11
use yii\di\contracts\DependencyInterface;
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 InvalidDependency implements DependencyInterface
24
{
25
    public function resolve(ContainerInterface $container)
26
    {
27
        throw new NotFoundException('Invalid reference');
28
    }
29
}
30