Conditions | 4 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4.016 |
Changes | 0 |
1 | <?php |
||
71 | 1 | public function toArray() |
|
72 | { |
||
73 | 1 | $data = []; |
|
74 | |||
75 | 1 | $properties = ['query', 'body', 'urlPrefix', 'validation', 'serialization']; |
|
76 | 1 | foreach ($properties as $property) { |
|
77 | 1 | $value = $this->{$property}; |
|
78 | 1 | if (null !== $value) { |
|
79 | 1 | $data[$property] = $value; |
|
80 | } |
||
81 | } |
||
82 | |||
83 | 1 | if (null !== $this->matcher) { |
|
84 | $data['matcher'] = $this->matcher->toArray(); |
||
85 | } |
||
86 | |||
87 | 1 | return $data; |
|
88 | } |
||
89 | } |
||
90 |