| Conditions | 5 |
| Paths | 8 |
| Total Lines | 20 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | 36 | protected function get_property_items ($property, $items) { |
|
| 21 | 36 | if (count($items) === 1) { |
|
| 22 | 32 | $items = $items[0]; |
|
| 23 | } |
||
| 24 | 36 | $property = $this->$property; |
|
| 25 | /** |
||
| 26 | * @var string|string[] $items |
||
| 27 | */ |
||
| 28 | 36 | if (is_array($items)) { |
|
| 29 | 10 | $result = []; |
|
| 30 | 10 | foreach ($items as &$i) { |
|
| 31 | 10 | if (!array_key_exists($i, $property)) { |
|
| 32 | 6 | return null; |
|
| 33 | } |
||
| 34 | 10 | $result[$i] = $property[$i]; |
|
| 35 | } |
||
| 36 | 10 | return $result; |
|
| 37 | } |
||
| 38 | 32 | return @$property[$items]; |
|
| 39 | } |
||
| 40 | } |
||
| 41 |