Conditions | 6 |
Paths | 9 |
Total Lines | 27 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 6.0087 |
Changes | 0 |
1 | <?php |
||
45 | 9 | private function skip(ContextInterface $context) |
|
46 | { |
||
47 | 9 | $depth = 0; |
|
48 | 9 | $dataDepth = count($context->getDataStack()); |
|
49 | |||
50 | 9 | foreach ($context->getMetadataStack() as $metadata) { |
|
51 | 9 | if ($metadata instanceof TypeMetadataInterface) { |
|
52 | 9 | ++$depth; |
|
53 | 6 | } |
|
54 | |||
55 | 9 | if (!$metadata instanceof PropertyMetadataInterface) { |
|
56 | 9 | continue; |
|
57 | } |
||
58 | |||
59 | 9 | ++$depth; |
|
60 | |||
61 | 9 | if (!$metadata->hasMaxDepth()) { |
|
62 | continue; |
||
63 | } |
||
64 | |||
65 | 9 | if ($dataDepth - $depth > $metadata->getMaxDepth()) { |
|
66 | 9 | return true; |
|
67 | } |
||
68 | 6 | } |
|
69 | |||
70 | 9 | return false; |
|
71 | } |
||
72 | } |
||
73 |