| Conditions | 6 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function process(object $object, array $data): array |
||
| 40 | { |
||
| 41 | foreach ($data as $key => $value) { |
||
| 42 | if (array_key_exists($key, self::SUPPORTED_KEYS)) { |
||
| 43 | $filePath = $this->uploaderHelper->asset($object, self::SUPPORTED_KEYS[$key]['file']); |
||
| 44 | $currentRequest = $this->requestStack->getCurrentRequest(); |
||
| 45 | if (null !== $filePath && null !== $currentRequest && false === strpos($filePath, '://')) { |
||
| 46 | $filePath = $currentRequest->getSchemeAndHttpHost().$filePath; |
||
| 47 | } |
||
| 48 | $data['href'][self::SUPPORTED_KEYS[$key]['property']] = $filePath; |
||
| 49 | } |
||
| 50 | } |
||
| 51 | |||
| 52 | return $data; |
||
| 53 | } |
||
| 55 |