| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | final class GenericRequest implements Arrayable |
||
| 17 | { |
||
| 18 | private $data; |
||
| 19 | |||
| 20 | 6 | public static function create(iterable $data): self |
|
| 23 | } |
||
| 24 | |||
| 25 | 6 | public function __construct(iterable $data) |
|
| 26 | { |
||
| 27 | 6 | if ($data instanceof \Traversable) { |
|
| 28 | 1 | $data = \iterator_to_array($data); |
|
| 29 | } |
||
| 30 | |||
| 31 | 6 | $this->data = $data; |
|
| 32 | 6 | } |
|
| 33 | |||
| 34 | 5 | public function toArray(): array |
|
| 37 | } |
||
| 38 | } |
||
| 39 |