Completed
Pull Request — 1.x (#13)
by
unknown
35:03 queued 01:43
created

SimpleArrayParser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 10 3
1
<?php
2
3
namespace MetaHydrator\Parser;
4
5
6
class SimpleArrayParser extends AbstractParser
7
{
8
    /**
9
     * @param array[] $rawValue
10
     * @return array[]|null
11
     * @throws \MetaHydrator\Exception\ParsingException
12
     */
13
    public function parse($rawValue)
14
    {
15
        if ($rawValue === null) {
16
            return null;
17
        }
18
        if (is_array($rawValue) === false) {
19
            $this->throw();
20
        }
21
        return $rawValue;
22
    }
23
}
24