@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | /** |
41 | 41 | * @param array $array |
42 | - * @param array $searchKeys |
|
42 | + * @param string[] $searchKeys |
|
43 | 43 | * @return array |
44 | 44 | */ |
45 | 45 | protected function buildData(array $array, array $searchKeys) |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | * @param string $elementName |
39 | 39 | * @return array |
40 | 40 | */ |
41 | - public function findElement(array $array, $elementName){ |
|
42 | - foreach ($array as $key => $element){ |
|
43 | - if ($key !== $elementName){ |
|
44 | - if (!is_array($element)){ |
|
41 | + public function findElement(array $array, $elementName) { |
|
42 | + foreach ($array as $key => $element) { |
|
43 | + if ($key !== $elementName) { |
|
44 | + if (!is_array($element)) { |
|
45 | 45 | return []; |
46 | 46 | } |
47 | 47 | $result = $this->findElement($element, $elementName); |
48 | - if ($result){ |
|
48 | + if ($result) { |
|
49 | 49 | return $result; |
50 | 50 | } |
51 | - }else{ |
|
51 | + } else { |
|
52 | 52 | return $element; |
53 | 53 | } |
54 | 54 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | { |
84 | 84 | foreach ($array as $key => $value) { |
85 | 85 | if ($key !== $searchKey) { |
86 | - if (!is_array($value)){ |
|
86 | + if (!is_array($value)) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | $keyChain[] = $key; |
@@ -48,7 +48,7 @@ |
||
48 | 48 | if ($result){ |
49 | 49 | return $result; |
50 | 50 | } |
51 | - }else{ |
|
51 | + } else{ |
|
52 | 52 | return $element; |
53 | 53 | } |
54 | 54 | } |