Conditions | 5 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
31 | public function render($event) |
||
32 | { |
||
33 | $minPossibleRegistrations = 1; |
||
34 | if ($event->getMaxParticipants() > 0 && |
||
35 | $event->getMaxRegistrationsPerUser() >= $event->getFreePlaces() && |
||
36 | !$event->getEnableWaitlist() |
||
37 | ) { |
||
38 | 8 | $maxPossibleRegistrations = $event->getFreePlaces(); |
|
39 | } else { |
||
40 | 8 | $maxPossibleRegistrations = $event->getMaxRegistrationsPerUser(); |
|
41 | 8 | } |
|
42 | 8 | $result = [$maxPossibleRegistrations]; |
|
43 | 5 | if ($maxPossibleRegistrations >= $minPossibleRegistrations) { |
|
44 | 8 | $arrayWithZeroAsIndex = range($minPossibleRegistrations, $maxPossibleRegistrations); |
|
45 | 4 | $result = array_combine(range(1, count($arrayWithZeroAsIndex)), $arrayWithZeroAsIndex); |
|
46 | 4 | } |
|
47 | 4 | ||
48 | return $result; |
||
49 | 8 | } |
|
50 | } |
||
51 |