| Total Complexity | 5 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | final class SqlQueryResult implements \IteratorAggregate |
||
| 17 | { |
||
| 18 | private $data; |
||
| 19 | private $metadata; |
||
| 20 | private $columns; |
||
| 21 | |||
| 22 | public function __construct(array $data, array $metadata) |
||
| 23 | { |
||
| 24 | $this->data = $data; |
||
| 25 | $this->metadata = $metadata; |
||
| 26 | $this->columns = $this->getColumns() |
||
| 27 | } |
||
|
|
|||
| 28 | |||
| 29 | public function getData() : array |
||
| 30 | { |
||
| 31 | return $this->data; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getMetadata() : array |
||
| 35 | { |
||
| 36 | return $this->metadata; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function getIterator() : \Generator |
||
| 40 | { |
||
| 41 | $keys = \array_column($this->metadata, 0); |
||
| 42 | |||
| 43 | foreach ($this->data as $item) { |
||
| 57 |