| 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 | 12 | ||
| 22 | public function __construct(array $data, array $metadata) |
||
| 23 | 12 | { |
|
| 24 | 12 | $this->data = $data; |
|
| 25 | 12 | $this->metadata = $metadata; |
|
| 26 | $this->columns = $this->getColumns() |
||
| 27 | 10 | } |
|
|
|
|||
| 28 | |||
| 29 | 10 | public function getData() : array |
|
| 30 | { |
||
| 31 | return $this->data; |
||
| 32 | 2 | } |
|
| 33 | |||
| 34 | 2 | public function getMetadata() : array |
|
| 35 | { |
||
| 36 | return $this->metadata; |
||
| 37 | 2 | } |
|
| 38 | |||
| 39 | 2 | public function getIterator() : \Generator |
|
| 40 | { |
||
| 41 | 2 | $keys = \array_column($this->metadata, 0); |
|
| 42 | 2 | ||
| 43 | foreach ($this->data as $item) { |
||
| 57 |