| Conditions | 6 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function process($object, array $data): array |
||
| 26 | { |
||
| 27 | if (is_array($data) && array_key_exists('file_name', $data)) { |
||
| 28 | $filePath = $this->uploaderHelper->asset($object, 'file'); |
||
| 29 | $currentRequest = $this->requestStack->getCurrentRequest(); |
||
| 30 | if (null !== $filePath && null !== $currentRequest && false === strpos($filePath, '://')) { |
||
| 31 | $filePath = $currentRequest->getSchemeAndHttpHost().$filePath; |
||
| 32 | } |
||
| 33 | $data['href']['download'] = $filePath; |
||
| 34 | } |
||
| 35 | |||
| 36 | return $data; |
||
| 37 | } |
||
| 39 |