| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 51 | public function parseResponse($responseLine, $responseData) |
||
| 52 | { |
||
| 53 | $workflows = []; |
||
| 54 | foreach ($responseData['workflow'] as $workflow) { |
||
| 55 | $workflow = $workflow['@attributes'] ?? $workflow; |
||
| 56 | $object = new Workflow($workflow['name'], $workflow['group'], new ArrayCollection([]), $workflow['comment']); |
||
| 57 | $object |
||
| 58 | ->setId($workflow['id']) |
||
| 59 | ->setBoundToSchedule((int) $workflow['bound-to-schedule']) |
||
| 60 | ->setLastcommit((int) $workflow['lastcommit']) |
||
| 61 | ->setModified((int) $workflow['modified']) |
||
| 62 | ; |
||
| 63 | $workflows[] = $object; |
||
| 64 | } |
||
| 65 | return new ArrayCollection($workflows); |
||
|
|
|||
| 66 | } |
||
| 68 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: