| Current Path : /home/rtorresani/www/vendor/magento/module-customer/Model/Address/ |
| Current File : //home/rtorresani/www/vendor/magento/module-customer/Model/Address/CompositeValidator.php |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Customer\Model\Address;
/**
* Address composite validator.
*/
class CompositeValidator implements ValidatorInterface
{
/**
* @var ValidatorInterface[]
*/
private $validators;
/**
* @param array $validators
*/
public function __construct(
array $validators = []
) {
$this->validators = $validators;
}
/**
* @inheritdoc
*/
public function validate(AbstractAddress $address)
{
$errors = [];
foreach ($this->validators as $validator) {
$errors[] = $validator->validate($address);
}
return array_merge([], ...$errors);
}
}