Skip to content

Commit

Permalink
Replace validator Zend classes with Laminas
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrsKondratjevs committed Mar 13, 2023
1 parent 50a6ff5 commit 03a4c64
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Theme/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@


use Magento\Framework\View\Design\Theme\Validator as MagentoValidator;
use Laminas\Validator\NotEmpty;
use Laminas\Validator\InArray;

class Validator extends MagentoValidator
{
Expand All @@ -21,14 +23,14 @@ protected function _setTypeValidators()
$typeValidators = [
[
'name' => 'not_empty',
'class' => 'Zend_Validate_NotEmpty',
'class' => NotEmpty::class,
'break' => true,
'options' => [],
'message' => (string)new \Magento\Framework\Phrase('Theme type can\'t be empty'),
],
[
'name' => 'available',
'class' => 'Zend_Validate_InArray',
'class' => InArray::class,
'break' => true,
'options' => [
'haystack' => [
Expand All @@ -41,9 +43,9 @@ protected function _setTypeValidators()
'message' => (string)new \Magento\Framework\Phrase('Theme type is invalid')
],
];

$this->addDataValidators('type', $typeValidators);

return $this;
}
}

0 comments on commit 03a4c64

Please sign in to comment.