Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
39 | 9 | protected function createItemFromStdClass(stdClass $content): object |
|
40 | { |
||
41 | 9 | if (isset($content->{'Acepta'})) { |
|
42 | 9 | $source = $content->{'Acepta'}; |
|
43 | 9 | $answer = CancelAnswer::accept(); |
|
44 | 9 | } elseif (isset($content->{'Rechaza'})) { |
|
45 | 9 | $source = $content->{'Rechaza'}; |
|
46 | 9 | $answer = CancelAnswer::reject(); |
|
47 | } else { |
||
48 | 1 | $source = (object)[]; |
|
49 | 1 | $answer = CancelAnswer::accept(); |
|
50 | } |
||
51 | 9 | return new AcceptRejectUuidItem( |
|
52 | 9 | strval($source->uuid ?? ''), |
|
53 | 9 | new AcceptRejectUuidStatus($source->status ?? '0'), |
|
54 | 9 | $answer |
|
55 | ); |
||
58 |