From b74a1c5e448937c9e099fe314ed24418947bdf54 Mon Sep 17 00:00:00 2001 From: Aleksandr Date: Mon, 27 Jun 2022 17:51:10 +0300 Subject: [PATCH] improves check of array whether multidimensional Signed-off-by: Aleksandr --- src/View/Helper/FlashMessengerFactory.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/View/Helper/FlashMessengerFactory.php b/src/View/Helper/FlashMessengerFactory.php index 8bed9c4..2aed9cf 100644 --- a/src/View/Helper/FlashMessengerFactory.php +++ b/src/View/Helper/FlashMessengerFactory.php @@ -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; } /**