Completed
Push — develop ( b9b8dc...f49312 )
by Baptiste
02:08
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 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
ccs 2
cts 2
cp 1
rs 9.4285
cc 1
eloc 1
nc 1
nop 2
crap 1
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
    Definitions,
9
    Exception\ValueNotSupported,
10
    Exception\DecoratedArgumentCannotBeResolved
11
};
12
use Innmind\Immutable\StreamInterface;
13
14
final class Decorate implements Argument
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19 5
    public static function fromValue($value): Argument
20
    {
21 5
        if ($value !== '@decorated') {
22 1
            throw new ValueNotSupported;
23
        }
24
25 4
        return new self;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 1
    public function resolve(
32
        StreamInterface $built,
33
        Definitions $definitions
34
    ): StreamInterface {
35 1
        throw new DecoratedArgumentCannotBeResolved;
36
    }
37
}
38