Passed
Push — master ( a0b884...c45d95 )
by Jesse
03:03
created

Properties::writeData()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
nc 2
nop 3
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Stratadox\Hydration\Mapping;
6
7
use Closure;
8
use Stratadox\HydrationMapping\MapsProperties;
9
use Stratadox\HydrationMapping\MapsProperty;
10
use Stratadox\ImmutableCollection\ImmutableCollection;
11
12
/**
13
 * Defines how to map a specific structure of data to an object.
14
 *
15
 * @package Stratadox\Hydrate
16
 * @author Stratadox
17
 */
18
final class Properties extends ImmutableCollection implements MapsProperties
19
{
20
    public function __construct(MapsProperty ...$properties)
21
    {
22
        parent::__construct(...$properties);
23
    }
24
25
    /**
26
     * Creates a new list of property mappings.
27
     *
28
     * @param MapsProperty[] ...$properties The property mappings.
29
     * @return Properties                   The property mapping container.
30
     */
31
    public static function map(
32
        MapsProperty ...$properties
33
    ) : self
34
    {
35
        return new self(...$properties);
36
    }
37
38
    /** @inheritdoc */
39
    public function current() : MapsProperty
40
    {
41
        return parent::current();
42
    }
43
44
    /** @inheritdoc */
45
    public function offsetGet($offset) : MapsProperty
46
    {
47
        return parent::offsetGet($offset);
48
    }
49
}
50