Skip to content

Commit

Permalink
improves check of array whether multidimensional
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandr <[email protected]>
  • Loading branch information
kliker002 committed Jun 27, 2022
1 parent 873e9b1 commit b74a1c5
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/View/Helper/FlashMessengerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,17 +118,14 @@ private function createHelperWithActualConfig($flashMessenger, $configHelper)
*/
private function isArrayOneDimensional(array $array): bool
{
$isArrayOneDimensional = true;

/** @var string|array $property */
/** @var mixed $property */
foreach ($array as $property) {
if (is_array($property)) {
$isArrayOneDimensional = false;
break;
return false;
}
}

return $isArrayOneDimensional;
return true;
}

/**
Expand Down

0 comments on commit b74a1c5

Please sign in to comment.