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