Passed
Push — master ( 010c64...640715 )
by Jesse
05:03
created

ScalarExtractor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\EntityState\Internal;
4
5
use Stratadox\EntityState\PropertyState;
6
use Stratadox\IdentityMap\MapsObjectsByIdentity as Map;
7
8
final class ScalarExtractor implements Extractor
9
{
10
    private function __construct()
11
    {
12
    }
13
14
    public static function asLastResort(): Extractor
15
    {
16
        return new self();
17
    }
18
19
    public function extract(
20
        Name $name,
21
        $value,
22
        Map $map,
23
        Visited $visited,
24
        Extractor $baseExtractor = null
25
    ): array {
26
        return [PropertyState::with((string) $name, $value)];
27
    }
28
}
29