| Conditions | 7 |
| Paths | 6 |
| Total Lines | 29 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function skipClass(ClassMetadataInterface $class, ContextInterface $context) |
||
| 39 | { |
||
| 40 | $references = []; |
||
| 41 | $dataStack = $context->getDataStack(); |
||
| 42 | $metadataStack = $context->getMetadataStack(); |
||
| 43 | |||
| 44 | for ($i = $metadataStack->count() - 1; $i > 0; --$i) { |
||
| 45 | $data = $dataStack[$i]; |
||
| 46 | $metadata = $metadataStack[$i]; |
||
| 47 | |||
| 48 | if (!$metadata instanceof ClassMetadataInterface || !is_object($data)) { |
||
| 49 | continue; |
||
| 50 | } |
||
| 51 | |||
| 52 | $hash = spl_object_hash($data); |
||
| 53 | |||
| 54 | if (!isset($references[$hash])) { |
||
| 55 | $references[$hash] = 0; |
||
| 56 | } |
||
| 57 | |||
| 58 | foreach ($references as &$reference) { |
||
| 59 | if (++$reference >= $this->limit) { |
||
| 60 | return true; |
||
| 61 | } |
||
| 62 | } |
||
| 63 | } |
||
| 64 | |||
| 65 | return false; |
||
| 66 | } |
||
| 67 | } |
||
| 68 |