Conditions | 5 |
Paths | 4 |
Total Lines | 29 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 14.8579 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 1 | protected function _parse(&$variable) |
|
18 | { |
||
19 | if ( |
||
20 | 1 | !is_object($variable) |
|
21 | || |
||
22 | 1 | !$variable instanceof \SplObjectStorage |
|
23 | ) { |
||
24 | 1 | return false; |
|
25 | } |
||
26 | |||
27 | /** @var $variable \SplObjectStorage */ |
||
28 | |||
29 | $count = $variable->count(); |
||
30 | if ($count === 0) { |
||
31 | return false; |
||
32 | } |
||
33 | |||
34 | $variable->rewind(); |
||
35 | while ($variable->valid()) { |
||
36 | $current = $variable->current(); |
||
37 | $this->value[] = KintParser::factory($current); |
||
38 | $variable->next(); |
||
39 | } |
||
40 | |||
41 | $this->type = 'Storage contents'; |
||
42 | $this->size = $count; |
||
43 | |||
44 | return true; |
||
45 | } |
||
46 | } |
||
47 |