Completed
Push — standalone ( 1b0272...9e8eb1 )
by Philip
04:15
created

ParseUtils::parseStringArray()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 3
nc 1
nop 1
crap 2
1
<?php
2
3
namespace Dontdrinkandroot\RestBundle\Metadata\Annotation;
4
5
/**
6
 * @author Philip Washington Sorst <[email protected]>
7
 */
8
class ParseUtils
9
{
10 30
    public static function parseBool(?bool $value): ?bool
11
    {
12 30
        assert(null === $value || is_bool($value));
13
14 30
        return $value;
15
    }
16
17 46
    public static function parseString(?string $value): ?bool
18
    {
19 46
        assert(null === $value || is_string($value));
20
21 46
        return $value;
22
    }
23
24 48
    public static function parseStringArray(?array $value): ?array
25
    {
26 48
        assert(null === $value || is_array($value));
27
28 48
        return $value;
29
    }
30
}
31