Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AbstractValidator.php
Go to the documentation of this file.
1 <?php
7 
14 abstract class AbstractValidator implements ValidatorInterface
15 {
19  private $resultInterfaceFactory;
20 
24  public function __construct(
25  ResultInterfaceFactory $resultFactory
26  ) {
27  $this->resultInterfaceFactory = $resultFactory;
28  }
29 
38  protected function createResult($isValid, array $fails = [], array $errorCodes = [])
39  {
40  return $this->resultInterfaceFactory->create(
41  [
42  'isValid' => (bool)$isValid,
43  'failsDescription' => $fails,
44  'errorCodes' => $errorCodes
45  ]
46  );
47  }
48 }
createResult($isValid, array $fails=[], array $errorCodes=[])
__construct(ResultInterfaceFactory $resultFactory)