Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function loadClassMetadata(ClassMetadata $metadata): bool |
||
39 | { |
||
40 | if (!$this->uploadsHelper->isConfigured($metadata->getClassName())) { |
||
41 | return false; |
||
42 | } |
||
43 | |||
44 | $fields = $this->uploadsHelper->getConfiguredProperties($metadata->getClassName(), true, false); |
||
45 | |||
46 | foreach ($fields as $fileField) { |
||
47 | $metadata->addPropertyConstraint($fileField, new Assert\NotNull(['groups' => sprintf('%s:create', $metadata->getClassName())])); |
||
|
|||
48 | } |
||
49 | |||
50 | return true; |
||
51 | } |
||
53 |