Replace NotAList with assert

Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
Kamil Tekiela 2024-03-13 17:15:28 +01:00
parent 7bbe293271
commit 2f7161fff9
2 changed files with 2 additions and 15 deletions

View File

@ -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] === '#') {

View File

@ -1,11 +0,0 @@
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Exceptions;
use RuntimeException;
class NotAList extends RuntimeException
{
}