Conditions | 5 |
Paths | 9 |
Total Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | public function isFailed(): bool |
||
24 | { |
||
25 | $amountOfLinks = 0; |
||
26 | |||
27 | // First check all accessible properties that are strings |
||
28 | foreach ($this->registration->_getProperties() as $value) { |
||
29 | if (!is_string($value)) { |
||
30 | continue; |
||
31 | } |
||
32 | |||
33 | $amountOfLinks += $this->getAmountOfLinks($value); |
||
34 | } |
||
35 | |||
36 | // Next check all values of possible registration fields |
||
37 | foreach ($this->registration->getFieldValues() as $fieldValue) { |
||
38 | if (!is_string($fieldValue->getValue())) { |
||
39 | continue; |
||
40 | } |
||
41 | |||
42 | $amountOfLinks += $this->getAmountOfLinks($fieldValue->getValue()); |
||
43 | } |
||
44 | |||
45 | return $amountOfLinks > (int)$this->configuration['maxAmountOfLinks']; |
||
46 | } |
||
47 | |||
65 |