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

ParseUtils   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 23
ccs 9
cts 9
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A parseBool() 0 6 2
A parseString() 0 6 2
A parseStringArray() 0 6 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