Conditions | 2 |
Paths | 2 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | 6 | public function getIterator(): Traversable |
|
23 | { |
||
24 | 6 | if (!in_array(StreamWrapper::NAME, stream_get_wrappers())) { |
|
25 | 1 | stream_wrapper_register(StreamWrapper::NAME, StreamWrapper::class); |
|
26 | } |
||
27 | |||
28 | 6 | $stream = fopen(StreamWrapper::NAME . '://stream', 'rb', false, stream_context_create([ |
|
29 | 6 | StreamWrapper::NAME => ['stream' => $this->source], |
|
30 | 6 | ])); |
|
31 | |||
32 | 6 | return new JsonResource($stream, $this->config); |
|
33 | } |
||
55 |