| Conditions | 4 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | public function validate($data, array $context = []) |
||
| 39 | { |
||
| 40 | if (is_object($data) && $this->publishableHelper->isPublishable($data) && $this->publishableHelper->hasPublicationDate($data)) { |
||
| 41 | $groups = $context['groups'] ?? ['Default']; |
||
| 42 | $groups[] = (new \ReflectionClass(get_class($data)))->getShortName().':published'; |
||
| 43 | $context['groups'] = $groups; |
||
| 44 | } |
||
| 45 | |||
| 46 | $this->decorated->validate($data, $context); |
||
| 47 | } |
||
| 48 | } |