| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 4 | public function isCompliant(NormalizerContextInterface $context, $object): bool |
|
| 36 | { |
||
| 37 | 4 | if ([] === $this->groups) { |
|
| 38 | 1 | return true; |
|
| 39 | } |
||
| 40 | |||
| 41 | 3 | $contextGroups = $context->getAttribute(self::ATTRIBUTE_GROUPS, []); |
|
| 42 | |||
| 43 | 3 | foreach ($this->groups as $group) { |
|
| 44 | 3 | if (in_array($group, $contextGroups, true)) { |
|
| 45 | 3 | return true; |
|
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | 2 | return false; |
|
| 50 | } |
||
| 51 | } |
||
| 52 |