Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
44 | 12 | public function jsonSerialize() |
|
45 | { |
||
46 | 12 | $class = new \ReflectionClass($this); |
|
47 | 12 | $json = []; |
|
48 | |||
49 | 12 | foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) { |
|
50 | 12 | if (null !== ($value = $property->getValue($this))) { |
|
51 | 12 | $json[$property->getName()] = $value; |
|
52 | 8 | } |
|
53 | 8 | } |
|
54 | |||
55 | 12 | return $json; |
|
56 | } |
||
57 | } |