Metadata   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 21
ccs 9
cts 9
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A fromNative() 0 3 1
A __construct() 0 3 1
A toNative() 0 3 1
A makeEmpty() 0 3 1
1
<?php declare(strict_types=1);
2
/**
3
 * This file is part of the daikon-cqrs/metadata project.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Daikon\Metadata;
10
11
use Daikon\DataStructure\Map;
12
13
final class Metadata extends Map implements MetadataInterface
14
{
15 6
    private function __construct(iterable $metadata = [])
16
    {
17 6
        $this->init($metadata);
18 6
    }
19
20 3
    public static function makeEmpty(): self
21
    {
22 3
        return new self;
23
    }
24
25 2
    public function toNative(): array
26
    {
27 2
        return $this->unwrap();
28
    }
29
30
    /** @param array $state */
31 4
    public static function fromNative($state): self
32
    {
33 4
        return new self($state);
34
    }
35
}
36