Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CompositeReader.php
Go to the documentation of this file.
1 <?php
7 
11 
16 {
20  private $validator;
21 
25  private $readers;
26 
33  public function __construct(ValidatorInterface $validator, array $readers)
34  {
35  $this->validator = $validator;
36  $this->readers = $readers;
37  }
38 
45  public function read($scope = null)
46  {
47  $result = [];
48  foreach ($this->readers as $reader) {
49  $result = array_replace_recursive($result, $reader->read($scope));
50  }
51  $this->validator->validate($result);
52  return $result;
53  }
54 }
__construct(ValidatorInterface $validator, array $readers)