Moved TagsMode to its own enum

This commit is contained in:
Alejandro Celaya
2022-04-23 18:56:27 +02:00
parent e8f7daac6f
commit 6ada704bc3
10 changed files with 64 additions and 49 deletions

View File

@@ -9,6 +9,7 @@ use Laminas\Validator\InArray;
use Shlinkio\Shlink\Common\Paginator\Paginator;
use Shlinkio\Shlink\Common\Validation;
use Shlinkio\Shlink\Core\Model\ShortUrlsParams;
use Shlinkio\Shlink\Core\ShortUrl\Model\TagsMode;
class ShortUrlsParamsInputFilter extends InputFilter
{
@@ -43,7 +44,7 @@ class ShortUrlsParamsInputFilter extends InputFilter
$tagsMode = $this->createInput(self::TAGS_MODE, false);
$tagsMode->getValidatorChain()->attach(new InArray([
'haystack' => [ShortUrlsParams::TAGS_MODE_ALL, ShortUrlsParams::TAGS_MODE_ANY],
'haystack' => [TagsMode::ALL->value, TagsMode::ANY->value],
'strict' => InArray::COMPARE_STRICT,
]));
$this->add($tagsMode);