From 2f7161fff99c92f7c2986abaa728774116425462 Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Wed, 13 Mar 2024 17:15:28 +0100 Subject: [PATCH] Replace NotAList with assert Signed-off-by: Kamil Tekiela --- src/Config/Form.php | 6 ++---- src/Exceptions/NotAList.php | 11 ----------- 2 files changed, 2 insertions(+), 15 deletions(-) delete mode 100644 src/Exceptions/NotAList.php diff --git a/src/Config/Form.php b/src/Config/Form.php index 972924e401..f306d4fd27 100644 --- a/src/Config/Form.php +++ b/src/Config/Form.php @@ -7,8 +7,8 @@ declare(strict_types=1); namespace PhpMyAdmin\Config; -use PhpMyAdmin\Exceptions\NotAList; use PhpMyAdmin\Exceptions\UndefinedOption; +use Webmozart\Assert\Assert; use function array_combine; use function array_shift; @@ -113,9 +113,7 @@ class Form throw new UndefinedOption($optionPath . ' - select options not defined'); } - if (! is_array($value)) { - throw new NotAList($optionPath . ' - not a static value list'); - } + Assert::isArray($value, $optionPath . ' - not a static value list'); // convert array('#', 'a', 'b') to array('a', 'b') if (isset($value[0]) && $value[0] === '#') { diff --git a/src/Exceptions/NotAList.php b/src/Exceptions/NotAList.php deleted file mode 100644 index 11562c179e..0000000000 --- a/src/Exceptions/NotAList.php +++ /dev/null @@ -1,11 +0,0 @@ -