Conditions | 6 |
Paths | 5 |
Total Lines | 24 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
60 | 7 | public function getElements(): array |
|
61 | { |
||
62 | 7 | $elements = $this->wrapped->getElements(); |
|
63 | |||
64 | /** |
||
65 | * @var int $k |
||
66 | */ |
||
67 | 7 | foreach ($elements as $k => $element) { |
|
68 | /** |
||
69 | * @var Element|ElementRef|ElementSingle|GroupRef $e |
||
70 | */ |
||
71 | 7 | $e = clone $element; |
|
72 | 7 | if ($this->getMax() > 0 || $this->getMax() === -1) { |
|
73 | 7 | $e->setMax($this->getMax()); |
|
74 | } |
||
75 | |||
76 | 7 | if ($this->getMin() > 1 && $e->getMin() === 1) { |
|
77 | 2 | $e->setMin($this->getMin()); |
|
78 | } |
||
79 | |||
80 | 7 | $elements[$k] = $e; |
|
81 | } |
||
82 | |||
83 | 7 | return $elements; |
|
84 | } |
||
91 |