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