Conditions | 5 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 2 | ||
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 = [(new \ReflectionClass(get_class($data)))->getShortName().':published']; |
||
42 | if (!empty($this->publishableHelper->getConfiguration($data)->validationGroups)) { |
||
43 | $groups = $this->publishableHelper->getConfiguration($data)->validationGroups; |
||
44 | } |
||
45 | $context['groups'] = array_merge($context['groups'] ?? ['Default'], $groups); |
||
46 | } |
||
47 | |||
48 | $this->decorated->validate($data, $context); |
||
49 | } |
||
50 | } |