Passed
Pull Request — master (#78)
by Dmitriy
02:32
created

InvalidDefinition::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Factory\Definition;
6
7
use Psr\Container\ContainerInterface;
8
use Yiisoft\Factory\Exception\NotFoundException;
9
10
/**
11
 * An invalid dependency is created when a parameter has no type and no default value.
12
 * For example:
13
 * ```php
14
 * public function __construct($a, $b) {}
15
 * ```
16
 *
17
 * These dependency must be replaced, attempting to resolve them will throw an exception
18
 */
19
class InvalidDefinition implements DefinitionInterface
20
{
21
    public function resolve(ContainerInterface $container)
22
    {
23
        throw new NotFoundException('Invalid reference');
24
    }
25
}
26