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 @@ -