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

InvalidDefinition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 5
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A resolve() 0 3 1
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