| Conditions | 6 |
| Paths | 9 |
| Total Lines | 30 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | private function skip(ContextInterface $context) |
||
| 46 | { |
||
| 47 | $metadataStack = $context->getMetadataStack(); |
||
| 48 | $stackDepth = count($context->getDataStack()); |
||
| 49 | $depth = 0; |
||
| 50 | |||
| 51 | for ($i = $metadataStack->count() - 1; $i > 0; --$i) { |
||
| 52 | $metadata = $metadataStack[$i]; |
||
| 53 | |||
| 54 | if ($metadata instanceof TypeMetadataInterface) { |
||
| 55 | ++$depth; |
||
| 56 | } |
||
| 57 | |||
| 58 | if (!$metadata instanceof PropertyMetadataInterface) { |
||
| 59 | continue; |
||
| 60 | } |
||
| 61 | |||
| 62 | ++$depth; |
||
| 63 | |||
| 64 | if (!$metadata->hasMaxDepth()) { |
||
| 65 | continue; |
||
| 66 | } |
||
| 67 | |||
| 68 | if ($stackDepth - $depth > $metadata->getMaxDepth()) { |
||
| 69 | return true; |
||
| 70 | } |
||
| 71 | } |
||
| 72 | |||
| 73 | return false; |
||
| 74 | } |
||
| 75 | } |
||
| 76 |