ArrayDeserializer::typeFor()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Stratadox\Deserializer;
5
6
/**
7
 * Deserializes the input array into collection arrays, serving as null object
8
 * for collection deserializers.
9
 *
10
 * @author Stratadox
11
 */
12
final class ArrayDeserializer implements Deserializer
13
{
14
    /**
15
     * Makes a new deserializer for arrays.
16
     *
17
     * @return Deserializer The array deserializer.
18
     */
19
    public static function make(): Deserializer
20
    {
21
        return new ArrayDeserializer;
22
    }
23
24
    /** @inheritdoc */
25
    public function from(array $input): array
26
    {
27
        return $input;
28
    }
29
30
    /** @inheritdoc */
31
    public function typeFor(array $input): string
32
    {
33
        return 'array';
34
    }
35
}
36