Completed
Push — develop ( 15ec3c...8b62a8 )
by Baptiste
02:19
created

Decorate::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
declare(strict_types = 1);
3
4
namespace Innmind\Compose\Definition\Service\Argument;
5
6
use Innmind\Compose\{
7
    Definition\Service\Argument,
8
    Definition\Service\Arguments,
9
    Services,
10
    Compilation\Service\Argument as CompiledArgument,
11
    Exception\ValueNotSupported,
12
    Exception\DecoratedArgumentCannotBeResolved,
13
    Exception\DecoratedArgumentCannotBeCompiled
14
};
15
use Innmind\Immutable\StreamInterface;
16
17
final class Decorate implements Argument
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22 33
    public static function fromValue($value, Arguments $arguments): Argument
23
    {
24 33
        if ($value !== '@decorated') {
25 23
            throw new ValueNotSupported;
26
        }
27
28 18
        return new self;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 1
    public function resolve(
35
        StreamInterface $built,
36
        Services $services
37
    ): StreamInterface {
38 1
        throw new DecoratedArgumentCannotBeResolved;
39
    }
40
41 1
    public function compile(): CompiledArgument
42
    {
43 1
        throw new DecoratedArgumentCannotBeCompiled;
44
    }
45
}
46