Completed
Push — master ( c2d23a...f43081 )
by Jesse
02:42
created

ArrayHydrator::classFor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Stratadox\Hydrator;
5
6
/**
7
 * Hydrates an array. Since the input is already array, do nothing, really.
8
 *
9
 * @package Stratadox\Hydrate
10
 * @author  Stratadox
11
 */
12
final class ArrayHydrator implements Hydrates
13
{
14
    /**
15
     * Creates a new array hydrator.
16
     *
17
     * @return Hydrates
18
     */
19
    public static function create(): Hydrates
20
    {
21
        return new self;
22
    }
23
24
    /** @inheritdoc */
25
    public function fromArray(array $input)
26
    {
27
        return $input;
28
    }
29
30
    /** @inheritdoc */
31
    public function classFor(array $input): string
32
    {
33
        return 'array';
34
    }
35
}
36