Conditions | 2 |
Paths | 2 |
Total Lines | 7 |
Code Lines | 3 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
26 | public function __invoke(object $data, string $property, Request $request, UploadableAttributeReader $annotationReader, UploadableFileManager $uploadableFileManager) |
||
27 | { |
||
28 | if (!$annotationReader->isConfigured($data)) { |
||
29 | throw new InvalidArgumentException(sprintf('%s is not an uploadable resource. It should not be configured to use %s.', $data::class, __CLASS__)); |
||
30 | } |
||
31 | |||
32 | return $uploadableFileManager->getFileResponse($data, $property, $request->query->getBoolean('download', false)); |
||
33 | } |
||
35 |