Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
DataCollectionTypeSafe | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
3 | |
100.00% |
1 / 1 |
jsonSerialize | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | |
3 | abstract class DataCollectionTypeSafe implements JsonSerializable { |
4 | public function jsonSerialize(): mixed { |
5 | $jsonData = []; |
6 | |
7 | foreach ($this as $key => $value) { |
8 | if (substr($key, 0, 1) != '_') { |
9 | $jsonData[$key] = $value; |
10 | } |
11 | } |
12 | |
13 | return $jsonData; |
14 | } |
15 | } |