1 | <?php |
||
15 | class ArrayHelper |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | protected $resultValue = []; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $resultKey = []; |
||
26 | |||
27 | /** |
||
28 | * ArrayHelper constructor. |
||
29 | */ |
||
30 | 1 | public function __construct() |
|
33 | |||
34 | /** |
||
35 | * @param $array |
||
36 | * @param int $parentCode |
||
37 | * @param $parentKey |
||
38 | * @return $this |
||
39 | */ |
||
40 | 1 | public function serializeArray($array, $parentCode = 0, $parentKey = '') |
|
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | 1 | public function getValue() |
|
63 | |||
64 | /** |
||
65 | * @return array |
||
66 | */ |
||
67 | public function getKeys() |
||
71 | |||
72 | /** |
||
73 | * @param $key |
||
74 | * @return mixed |
||
75 | */ |
||
76 | public function getKey($key) |
||
80 | |||
81 | /** |
||
82 | * @param $array |
||
83 | * @param $keys |
||
84 | * @param string $delimiter |
||
85 | * @return null |
||
86 | */ |
||
87 | 1 | public function getDeep($array, $keys, $delimiter = '.') |
|
104 | |||
105 | /** |
||
106 | * @param $array |
||
107 | * @return bool |
||
108 | */ |
||
109 | 1 | public function isMapArray($array) |
|
119 | } |
This check looks for the bodies of
if
statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.These
if
bodies can be removed. If you have an empty if but statements in theelse
branch, consider inverting the condition.could be turned into
This is much more concise to read.