Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompositeValidator.php
Go to the documentation of this file.
1 <?php
7 
12 {
18  private $validators;
19 
25  public function __construct($validators)
26  {
27  $this->validators = $validators;
28  }
29 
38  public function validate($configData)
39  {
40  foreach ($this->validators as $validator) {
41  if (!$validator instanceof ValidatorInterface) {
42  throw new \LogicException(
43  sprintf(
44  'Validator [%s] does not implements ' .
45  'Magento\Framework\MessageQueue\Publisher\Config\ValidatorInterface',
46  get_class($validator)
47  )
48  );
49  }
50  $validator->validate($configData);
51  }
52  }
53 }