@@ 18-29 (lines=12) @@ | ||
15 | * |
|
16 | * @throws ParsingException |
|
17 | */ |
|
18 | public function parse($rawValue) |
|
19 | { |
|
20 | if ($rawValue === null || $rawValue === '') { |
|
21 | return null; |
|
22 | } else { |
|
23 | $value = filter_var($rawValue, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE); |
|
24 | if ($value === null) { |
|
25 | $this->throw(); |
|
26 | } |
|
27 | return $value; |
|
28 | } |
|
29 | } |
|
30 | } |
|
31 |
@@ 13-24 (lines=12) @@ | ||
10 | * @return mixed|null |
|
11 | * @throws \MetaHydrator\Exception\ParsingException |
|
12 | */ |
|
13 | public function parse($rawValue) |
|
14 | { |
|
15 | if ($rawValue === null || $rawValue === '') { |
|
16 | return null; |
|
17 | } else { |
|
18 | $value = is_array($rawValue); |
|
19 | if ($value === false) { |
|
20 | $this->throw(); |
|
21 | } |
|
22 | return $rawValue; |
|
23 | } |
|
24 | } |
|
25 | } |
|
26 |