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

Properties::offsetGet()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
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