@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | $this->new_fileName = ''; |
241 | 241 | } |
242 | 242 | |
243 | - $enableByConfiguration = (bool)$this->fl_conf['enable']; |
|
243 | + $enableByConfiguration = (bool) $this->fl_conf['enable']; |
|
244 | 244 | if (!$enableByConfiguration) { |
245 | 245 | $this->enable = $enableByConfiguration; |
246 | 246 | } |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $hashBase = PathUtility::pathinfo($this->org_fileName, PATHINFO_BASENAME); |
447 | 447 | } |
448 | 448 | $hashLength = isset($this->fl_conf['hashLength']) ? MathUtility::forceIntegerInRange( |
449 | - (int)$this->fl_conf['hashLength'], |
|
449 | + (int) $this->fl_conf['hashLength'], |
|
450 | 450 | 0, |
451 | 451 | strlen($hashBase) |
452 | 452 | ) : 0; |
@@ -523,8 +523,8 @@ discard block |
||
523 | 523 | if ($cache->has($cacheIdent)) { |
524 | 524 | $data = unserialize($cache->get($new_fileName)); |
525 | 525 | $pids = GeneralUtility::intExplode(',', $data['page_id'], true); |
526 | - if (!in_array((int)$GLOBALS['TSFE']->id, $pids)) { |
|
527 | - $pids[] = (int)$GLOBALS['TSFE']->id; |
|
526 | + if (!in_array((int) $GLOBALS['TSFE']->id, $pids)) { |
|
527 | + $pids[] = (int) $GLOBALS['TSFE']->id; |
|
528 | 528 | } |
529 | 529 | $data['tstamp'] = time(); |
530 | 530 | $data['page_id'] = implode(',', $pids); |
@@ -247,8 +247,8 @@ |
||
247 | 247 | |
248 | 248 | // enable |
249 | 249 | if ($this->new_fileName === 0 |
250 | - || !\is_array($GLOBALS['TSFE']->tmpl->setup['config.']['fl_realurl_image.']) // no static template |
|
251 | - || strtolower($this->new_fileName) === 'off' // fl_realurl_image switched off on this page |
|
250 | + || !\is_array($GLOBALS['TSFE']->tmpl->setup['config.']['fl_realurl_image.']) // no static template |
|
251 | + || strtolower($this->new_fileName) === 'off' // fl_realurl_image switched off on this page |
|
252 | 252 | |
253 | 253 | ) { |
254 | 254 | $this->enable = false; |
@@ -51,42 +51,42 @@ discard block |
||
51 | 51 | return $src; |
52 | 52 | } |
53 | 53 | |
54 | - try { |
|
55 | - $imageService = self::getImageService(); |
|
56 | - $image = $imageService->getImage($src, $image, $treatIdAsReference); |
|
54 | + try { |
|
55 | + $imageService = self::getImageService(); |
|
56 | + $image = $imageService->getImage($src, $image, $treatIdAsReference); |
|
57 | 57 | |
58 | - if ($cropString === null && $image->hasProperty('crop') && $image->getProperty('crop')) { |
|
59 | - $cropString = $image->getProperty('crop'); |
|
60 | - } |
|
58 | + if ($cropString === null && $image->hasProperty('crop') && $image->getProperty('crop')) { |
|
59 | + $cropString = $image->getProperty('crop'); |
|
60 | + } |
|
61 | 61 | |
62 | - $cropVariantCollection = CropVariantCollection::create((string)$cropString); |
|
63 | - $cropVariant = $arguments['cropVariant'] ?: 'default'; |
|
64 | - $cropArea = $cropVariantCollection->getCropArea($cropVariant); |
|
65 | - $processingInstructions = [ |
|
66 | - 'width' => $arguments['width'], |
|
67 | - 'height' => $arguments['height'], |
|
68 | - 'minWidth' => $arguments['minWidth'], |
|
69 | - 'minHeight' => $arguments['minHeight'], |
|
70 | - 'maxWidth' => $arguments['maxWidth'], |
|
71 | - 'maxHeight' => $arguments['maxHeight'], |
|
72 | - 'crop' => $cropArea->isEmpty() ? null : $cropArea->makeAbsoluteBasedOnFile($image), |
|
73 | - ]; |
|
62 | + $cropVariantCollection = CropVariantCollection::create((string)$cropString); |
|
63 | + $cropVariant = $arguments['cropVariant'] ?: 'default'; |
|
64 | + $cropArea = $cropVariantCollection->getCropArea($cropVariant); |
|
65 | + $processingInstructions = [ |
|
66 | + 'width' => $arguments['width'], |
|
67 | + 'height' => $arguments['height'], |
|
68 | + 'minWidth' => $arguments['minWidth'], |
|
69 | + 'minHeight' => $arguments['minHeight'], |
|
70 | + 'maxWidth' => $arguments['maxWidth'], |
|
71 | + 'maxHeight' => $arguments['maxHeight'], |
|
72 | + 'crop' => $cropArea->isEmpty() ? null : $cropArea->makeAbsoluteBasedOnFile($image), |
|
73 | + ]; |
|
74 | 74 | |
75 | - $processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions); |
|
76 | - return $imageService->getImageUri($processedImage, $absolute); |
|
77 | - } catch (ResourceDoesNotExistException $e) { |
|
78 | - // thrown if file does not exist |
|
79 | - throw new Exception($e->getMessage(), 1509741907, $e); |
|
80 | - } catch (\UnexpectedValueException $e) { |
|
81 | - // thrown if a file has been replaced with a folder |
|
82 | - throw new Exception($e->getMessage(), 1509741908, $e); |
|
83 | - } catch (\RuntimeException $e) { |
|
84 | - // RuntimeException thrown if a file is outside of a storage |
|
85 | - throw new Exception($e->getMessage(), 1509741909, $e); |
|
86 | - } catch (\InvalidArgumentException $e) { |
|
87 | - // thrown if file storage does not exist |
|
88 | - throw new Exception($e->getMessage(), 1509741910, $e); |
|
89 | - } |
|
75 | + $processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions); |
|
76 | + return $imageService->getImageUri($processedImage, $absolute); |
|
77 | + } catch (ResourceDoesNotExistException $e) { |
|
78 | + // thrown if file does not exist |
|
79 | + throw new Exception($e->getMessage(), 1509741907, $e); |
|
80 | + } catch (\UnexpectedValueException $e) { |
|
81 | + // thrown if a file has been replaced with a folder |
|
82 | + throw new Exception($e->getMessage(), 1509741908, $e); |
|
83 | + } catch (\RuntimeException $e) { |
|
84 | + // RuntimeException thrown if a file is outside of a storage |
|
85 | + throw new Exception($e->getMessage(), 1509741909, $e); |
|
86 | + } catch (\InvalidArgumentException $e) { |
|
87 | + // thrown if file storage does not exist |
|
88 | + throw new Exception($e->getMessage(), 1509741910, $e); |
|
89 | + } |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -96,8 +96,8 @@ discard block |
||
96 | 96 | */ |
97 | 97 | protected static function getImageService() |
98 | 98 | { |
99 | - /** @var ObjectManager $objectManager */ |
|
100 | - $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
|
101 | - return $objectManager->get(ImageService::class); |
|
99 | + /** @var ObjectManager $objectManager */ |
|
100 | + $objectManager = GeneralUtility::makeInstance(ObjectManager::class); |
|
101 | + return $objectManager->get(ImageService::class); |
|
102 | 102 | } |
103 | 103 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | $cropString = $image->getProperty('crop'); |
60 | 60 | } |
61 | 61 | |
62 | - $cropVariantCollection = CropVariantCollection::create((string)$cropString); |
|
62 | + $cropVariantCollection = CropVariantCollection::create((string) $cropString); |
|
63 | 63 | $cropVariant = $arguments['cropVariant'] ?: 'default'; |
64 | 64 | $cropArea = $cropVariantCollection->getCropArea($cropVariant); |
65 | 65 | $processingInstructions = [ |
@@ -53,8 +53,8 @@ |
||
53 | 53 | */ |
54 | 54 | protected function getImageService():ImageService |
55 | 55 | { |
56 | - /** @var ImageService $imageService */ |
|
57 | - $imageService = GeneralUtility::makeInstance(ImageService::class); |
|
58 | - return $imageService; |
|
56 | + /** @var ImageService $imageService */ |
|
57 | + $imageService = GeneralUtility::makeInstance(ImageService::class); |
|
58 | + return $imageService; |
|
59 | 59 | } |
60 | 60 | } |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | $imageTagValues = [ |
95 | - 'width' => (int)$info[0], |
|
96 | - 'height' => (int)$info[1], |
|
95 | + 'width' => (int) $info[0], |
|
96 | + 'height' => (int) $info[1], |
|
97 | 97 | 'params' => $params, |
98 | 98 | 'altParams' => $altParam, |
99 | - 'border' => $this->getBorderAttr(' border="' . (int)$conf['border'] . '"'), |
|
99 | + 'border' => $this->getBorderAttr(' border="' . (int) $conf['border'] . '"'), |
|
100 | 100 | 'sourceCollection' => $sourceCollection, |
101 | 101 | 'selfClosingTagSlash' => !empty($tsfe->xhtmlDoctype) ? ' /' : '', |
102 | 102 | ]; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $theValue = $this->imageLinkWrap($theValue, $originalFile, $conf['imageLinkWrap.']); |
125 | 125 | } |
126 | 126 | $wrap = isset($conf['wrap.']) ? $this->stdWrap($conf['wrap'], $conf['wrap.']) : $conf['wrap']; |
127 | - if ((string)$wrap !== '') { |
|
127 | + if ((string) $wrap !== '') { |
|
128 | 128 | $theValue = $this->wrap($theValue, $conf['wrap']); |
129 | 129 | } |
130 | 130 | return $theValue; |