| Total Complexity | 12 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Coverage | 84.62% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | abstract class AbstractArrayDriver implements ArrayDriverInterface |
||
| 9 | { |
||
| 10 | protected ObjectComparatorInterface $objectComparator; |
||
| 11 | |||
| 12 | 219 | public function __construct(ObjectComparatorInterface $objectComparator) |
|
| 13 | { |
||
| 14 | 219 | $this->objectComparator = $objectComparator; |
|
| 15 | } |
||
| 16 | |||
| 17 | public function retrieve(array $array, $item) |
||
| 18 | { |
||
| 19 | return $array[$item]; |
||
| 20 | } |
||
| 21 | |||
| 22 | 6 | public function remove(array &$array, $item): bool |
|
| 35 | } |
||
| 36 | |||
| 37 | 12 | public function contains(array $array, $item): bool |
|
| 38 | { |
||
| 39 | 12 | return is_object($item) |
|
| 40 | 6 | ? in_array($item, $array, true) |
|
| 41 | 12 | : isset($array[$item]); |
|
| 42 | } |
||
| 43 | |||
| 44 | 219 | protected function arrayContainsObject(array $array, object $object): bool |
|
| 53 | } |
||
| 54 | |||
| 55 | 6 | protected function deleteObjectIfLocated(array &$array, object $object): bool |
|
| 56 | { |
||
| 68 |