| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 66.67% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | class CustomSource extends Source |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Retrieve the JSON fragments |
||
| 16 | * |
||
| 17 | * @return Traversable<int, string> |
||
| 18 | */ |
||
| 19 | 2 | public function getIterator(): Traversable |
|
| 20 | { |
||
| 21 | 2 | yield from $this->source; |
|
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Determine whether the JSON source can be handled |
||
| 26 | * |
||
| 27 | * @return bool |
||
| 28 | */ |
||
| 29 | 130 | public function matches(): bool |
|
| 30 | { |
||
| 31 | 130 | return $this->source instanceof Source; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Retrieve the calculated size of the JSON source |
||
| 36 | * |
||
| 37 | * @return int|null |
||
| 38 | */ |
||
| 39 | protected function calculateSize(): ?int |
||
| 42 | } |
||
| 43 | } |
||
| 44 |