@@ -44,7 +44,7 @@ |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | public function viewAction(AmpInterface $object): Response { |
47 | - return $this->cacheService->get($this->getCacheKey($object), function () use ($object) { |
|
47 | + return $this->cacheService->get($this->getCacheKey($object), function() use ($object) { |
|
48 | 48 | $this->themeLoader->load(); |
49 | 49 | $content = $this->twig->render(sprintf('@%s/index.html.twig', ThemeLoaderInterface::THEME_NAMESPACE), [ |
50 | 50 | 'object' => $object, |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $redirectRoute = $this->redirectRouteRepository->findOneBy(['staticPrefix' => $candidates[0]]); |
73 | 73 | |
74 | 74 | if (null !== $redirectRoute) { |
75 | - $collection->add($redirectRoute->getRouteName() ?? '', $redirectRoute); |
|
75 | + $collection->add($redirectRoute->getRouteName() ?? '', $redirectRoute); |
|
76 | 76 | |
77 | 77 | return $collection; |
78 | 78 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | */ |
250 | 250 | private function getArrayOfIdsFromRoutesArray(array $routes): array |
251 | 251 | { |
252 | - return array_map(function ($route) { |
|
252 | + return array_map(function($route) { |
|
253 | 253 | return $route->getId(); |
254 | 254 | }, $routes); |
255 | 255 | } |
@@ -50,6 +50,6 @@ |
||
50 | 50 | unset($parameters[RouteObjectInterface::ROUTE_OBJECT]); |
51 | 51 | } |
52 | 52 | |
53 | - return 'Route for media ' . $name->getValues()->getId() . ' not found'; |
|
53 | + return 'Route for media '.$name->getValues()->getId().' not found'; |
|
54 | 54 | } |
55 | 55 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | try { |
46 | 46 | return $this->routingExtension->getPath($name, $parameters, $relative); |
47 | - } catch (RouteNotFoundException|MissingMandatoryParametersException|InvalidParameterException $e) { |
|
47 | + } catch (RouteNotFoundException | MissingMandatoryParametersException | InvalidParameterException $e) { |
|
48 | 48 | // allow empty path |
49 | 49 | } |
50 | 50 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | try { |
66 | 66 | return $this->routingExtension->getUrl($name, $parameters, $schemeRelative); |
67 | - } catch (RouteNotFoundException|MissingMandatoryParametersException|InvalidParameterException $e) { |
|
67 | + } catch (RouteNotFoundException | MissingMandatoryParametersException | InvalidParameterException $e) { |
|
68 | 68 | // allow empty url |
69 | 69 | } |
70 | 70 |
@@ -83,7 +83,7 @@ |
||
83 | 83 | $name = $route->getId(); |
84 | 84 | } |
85 | 85 | |
86 | - return md5($name . serialize($parameters) . $type); |
|
86 | + return md5($name.serialize($parameters).$type); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -123,8 +123,8 @@ |
||
123 | 123 | /** @var SlidingPagination $pagination */ |
124 | 124 | $pagination = $this->paginator->paginate( |
125 | 125 | $queryBuilder, |
126 | - (int) $input->getOption('page'), |
|
127 | - (int) $input->getOption('limit') |
|
126 | + (int) $input->getOption('page'), |
|
127 | + (int) $input->getOption('limit') |
|
128 | 128 | ); |
129 | 129 | |
130 | 130 | $output->writeln(sprintf('<bg=green;options=bold>Packages found: %s</>', $pagination->getTotalItemCount())); |
@@ -71,6 +71,6 @@ |
||
71 | 71 | $name = $parameters[RouteObjectInterface::ROUTE_OBJECT]; |
72 | 72 | unset($parameters[RouteObjectInterface::ROUTE_OBJECT]); |
73 | 73 | } |
74 | - return 'Route for article author media ' . $name->getValues()->getId() . ' not found'; |
|
74 | + return 'Route for article author media '.$name->getValues()->getId().' not found'; |
|
75 | 75 | } |
76 | 76 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT]; |
55 | 55 | unset($parameters[RouteObjectInterface::ROUTE_OBJECT]); |
56 | 56 | } |
57 | - return 'Route for media ' . $meta->getValues()->getId() . ' not found'; |
|
57 | + return 'Route for media '.$meta->getValues()->getId().' not found'; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function supports($name): bool { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | true === $parameters['webp'] && |
116 | 116 | $item->hasVariant(ImageInterface::VARIANT_WEBP) |
117 | 117 | ) { |
118 | - return str_replace('.' . $item->getFileExtension(), '.webp', $url); |
|
118 | + return str_replace('.'.$item->getFileExtension(), '.webp', $url); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | return $url; |
@@ -90,18 +90,18 @@ discard block |
||
90 | 90 | $pathParts = \pathinfo($object->getAvatarUrl()); |
91 | 91 | $assetId = \sha1($pathParts['filename']); |
92 | 92 | if (null !== $object->getSlug()) { |
93 | - $assetId = $object->getSlug() . '_' . $assetId; |
|
93 | + $assetId = $object->getSlug().'_'.$assetId; |
|
94 | 94 | } |
95 | 95 | $existingAvatar = $this->entityManager->getRepository(Image::class)->findBy(['assetId' => $assetId]); |
96 | 96 | if (\count($existingAvatar) > 0) { |
97 | - $object->setAvatarUrl((string)\reset($existingAvatar)); |
|
97 | + $object->setAvatarUrl((string) \reset($existingAvatar)); |
|
98 | 98 | |
99 | 99 | return $object; |
100 | 100 | } |
101 | 101 | |
102 | 102 | try { |
103 | - $tempDirectory = $this->cacheDirectory . \DIRECTORY_SEPARATOR . 'downloaded_avatars'; |
|
104 | - $tempLocation = $tempDirectory . \DIRECTORY_SEPARATOR . \sha1($assetId . date('his')); |
|
103 | + $tempDirectory = $this->cacheDirectory.\DIRECTORY_SEPARATOR.'downloaded_avatars'; |
|
104 | + $tempLocation = $tempDirectory.\DIRECTORY_SEPARATOR.\sha1($assetId.date('his')); |
|
105 | 105 | if (!$filesystem->exists($tempDirectory)) { |
106 | 106 | $filesystem->mkdir($tempDirectory); |
107 | 107 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->entityManager->persist($image); |
134 | 134 | |
135 | 135 | $object->setAvatar($avatar); |
136 | - $object->setAvatarUrl((string)$image); |
|
136 | + $object->setAvatarUrl((string) $image); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $object; |