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

ArrayHydrator   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 22
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A fromArray() 0 3 1
A create() 0 3 1
A classFor() 0 3 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