| Conditions | 7 |
| Paths | 5 |
| Total Lines | 21 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 7 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | private function isTooDeep(Context $context): bool |
||
| 27 | 6 | { |
|
| 28 | $relativeDepth = 0; |
||
| 29 | 6 | ||
| 30 | foreach ($context->getMetadataStack() as $metadata) { |
||
| 31 | if (!$metadata instanceof PropertyMetadata) { |
||
| 32 | 6 | continue; |
|
| 33 | } |
||
| 34 | 6 | ||
| 35 | 6 | $relativeDepth++; |
|
| 36 | |||
| 37 | 6 | if (0 === $metadata->maxDepth && $context->getMetadataStack()->top() === $metadata) { |
|
| 38 | continue; |
||
| 39 | 6 | } |
|
| 40 | 6 | ||
| 41 | 6 | if (null !== $metadata->maxDepth && $relativeDepth > $metadata->maxDepth) { |
|
| 42 | 6 | return true; |
|
| 43 | 6 | } |
|
| 44 | } |
||
| 45 | 6 | ||
| 46 | 6 | return false; |
|
| 47 | } |
||
| 49 |