Completed
Pull Request — master (#1218)
by
unknown
30s
created
src/SWP/Bundle/CoreBundle/Controller/AmpController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
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,
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -26,46 +26,46 @@
 block discarded – undo
26 26
 
27 27
 final class AmpController extends AbstractController {
28 28
 
29
-  private Environment $twig;
30
-  private AmpConverterInterface $converter;
31
-  private ThemeLoaderInterface $themeLoader;
32
-  private CacheInterface $cacheService;
29
+    private Environment $twig;
30
+    private AmpConverterInterface $converter;
31
+    private ThemeLoaderInterface $themeLoader;
32
+    private CacheInterface $cacheService;
33 33
 
34
-  public function __construct(
35
-      Environment           $twig,
36
-      AmpConverterInterface $ampConverter,
37
-      ThemeLoaderInterface  $ampThemeLoader,
38
-      CacheInterface        $cacheService
39
-  ) {
34
+    public function __construct(
35
+        Environment           $twig,
36
+        AmpConverterInterface $ampConverter,
37
+        ThemeLoaderInterface  $ampThemeLoader,
38
+        CacheInterface        $cacheService
39
+    ) {
40 40
     $this->twig = $twig;
41 41
     $this->converter = $ampConverter;
42 42
     $this->themeLoader = $ampThemeLoader;
43 43
     $this->cacheService = $cacheService;
44
-  }
44
+    }
45 45
 
46
-  public function viewAction(AmpInterface $object): Response {
46
+    public function viewAction(AmpInterface $object): Response {
47 47
     return $this->cacheService->get($this->getCacheKey($object), function () use ($object) {
48
-      $this->themeLoader->load();
49
-      $content = $this->twig->render(sprintf('@%s/index.html.twig', ThemeLoaderInterface::THEME_NAMESPACE), [
50
-          'object' => $object,
51
-      ]);
48
+        $this->themeLoader->load();
49
+        $content = $this->twig->render(sprintf('@%s/index.html.twig', ThemeLoaderInterface::THEME_NAMESPACE), [
50
+            'object' => $object,
51
+        ]);
52 52
 
53
-      $response = new Response();
54
-      $response->setContent($this->converter->convertToAmp($content));
55
-      return $response;
53
+        $response = new Response();
54
+        $response->setContent($this->converter->convertToAmp($content));
55
+        return $response;
56 56
     });
57
-  }
57
+    }
58 58
 
59
-  private function getCacheKey(AmpInterface $object): string {
59
+    private function getCacheKey(AmpInterface $object): string {
60 60
     $elements = ['amp_article'];
61 61
     if ($object instanceof PersistableInterface) {
62
-      $elements[] = $object->getId();
62
+        $elements[] = $object->getId();
63 63
     }
64 64
 
65 65
     if ($object instanceof TimestampableInterface && null !== $object->getUpdatedAt()) {
66
-      $elements[] = $object->getUpdatedAt()->getTimestamp();
66
+        $elements[] = $object->getUpdatedAt()->getTimestamp();
67 67
     }
68 68
 
69 69
     return md5(implode('__', $elements));
70
-  }
70
+    }
71 71
 }
Please login to merge, or discard this patch.
src/SWP/Bundle/ContentBundle/Provider/ORM/RouteProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/SWP/Bundle/ContentBundle/Routing/SeoMediaRouter.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,6 +50,6 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@  discard block
 block discarded – undo
25 25
 use Symfony\Component\Routing\Route as SymfonyRoute;
26 26
 
27 27
 class SeoMediaRouter extends Router implements VersatileGeneratorInterface {
28
-  /**
29
-   * {@inheritdoc}
30
-   */
31
-  public function generate($name, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) {
28
+    /**
29
+     * {@inheritdoc}
30
+     */
31
+    public function generate($name, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) {
32 32
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $name
33 33
         && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)
34 34
     ) {
35
-      $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
36
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
35
+        $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
36
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
37 37
     }
38 38
 
39 39
     $item = $name->getValues()->getImage();
@@ -42,20 +42,20 @@  discard block
 block discarded – undo
42 42
     $parameters['extension'] = $item->getFileExtension();
43 43
 
44 44
     return parent::generate('swp_seo_media_get', $parameters, $referenceType);
45
-  }
45
+    }
46 46
 
47
-  public function supports($name): bool {
47
+    public function supports($name): bool {
48 48
     return $name instanceof Meta && $name->getValues() instanceof ArticleSeoMediaInterface;
49
-  }
49
+    }
50 50
 
51
-  public function getRouteDebugMessage($name, array $parameters = array()): string {
51
+    public function getRouteDebugMessage($name, array $parameters = array()): string {
52 52
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $name
53 53
         && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)
54 54
     ) {
55
-      $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
56
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
55
+        $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
56
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
57 57
     }
58 58
 
59 59
     return 'Route for media ' . $name->getValues()->getId() . ' not found';
60
-  }
60
+    }
61 61
 }
Please login to merge, or discard this patch.
src/SWP/Bundle/ContentListBundle/Doctrine/ORM/ContentListItemRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,12 +76,12 @@
 block discarded – undo
76 76
 
77 77
             return $paginator->paginate(
78 78
                 $queryBuilder,
79
-                (int)$criteria->get('firstResult', 0),
80
-                (int)$criteria->get('maxResults', RepositoryInterface::MAX_RESULTS)
79
+                (int) $criteria->get('firstResult', 0),
80
+                (int) $criteria->get('maxResults', RepositoryInterface::MAX_RESULTS)
81 81
             );
82 82
         }
83 83
 
84
-        return $this->getPaginator( $eventDispatcher,$queryBuilder, $paginationData);
84
+        return $this->getPaginator($eventDispatcher, $queryBuilder, $paginationData);
85 85
     }
86 86
 
87 87
     public function getCountByCriteria(Criteria $criteria): int
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Twig/DecoratingRoutingExtension.php 2 patches
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -25,56 +25,56 @@
 block discarded – undo
25 25
 use Twig\TwigFunction;
26 26
 
27 27
 final class DecoratingRoutingExtension extends AbstractExtension {
28
-  private RoutingExtension $routingExtension;
28
+    private RoutingExtension $routingExtension;
29 29
 
30
-  public function __construct(RoutingExtension $routingExtension) {
30
+    public function __construct(RoutingExtension $routingExtension) {
31 31
     $this->routingExtension = $routingExtension;
32
-  }
32
+    }
33 33
 
34
-  public function getPath($name, $parameters = [], $relative = false): ?string {
34
+    public function getPath($name, $parameters = [], $relative = false): ?string {
35 35
     if ($name == null) {
36
-      return null;
36
+        return null;
37 37
     }
38 38
 
39 39
     if (is_object($name)) {
40
-      $object = $name;
41
-      $name = RouteObjectInterface::OBJECT_BASED_ROUTE_NAME;
42
-      $parameters[RouteObjectInterface::ROUTE_OBJECT] = $object;
40
+        $object = $name;
41
+        $name = RouteObjectInterface::OBJECT_BASED_ROUTE_NAME;
42
+        $parameters[RouteObjectInterface::ROUTE_OBJECT] = $object;
43 43
     }
44 44
 
45 45
     try {
46
-      return $this->routingExtension->getPath($name, $parameters, $relative);
46
+        return $this->routingExtension->getPath($name, $parameters, $relative);
47 47
     } catch (RouteNotFoundException|MissingMandatoryParametersException|InvalidParameterException $e) {
48
-      // allow empty path
48
+        // allow empty path
49 49
     }
50 50
 
51 51
     return null;
52
-  }
52
+    }
53 53
 
54
-  public function getUrl($name, $parameters = [], $schemeRelative = false): ?string {
54
+    public function getUrl($name, $parameters = [], $schemeRelative = false): ?string {
55 55
     if ($name == null) {
56
-      return null;
56
+        return null;
57 57
     }
58 58
 
59 59
     if (is_object($name)) {
60
-      $object = $name;
61
-      $name = RouteObjectInterface::OBJECT_BASED_ROUTE_NAME;
62
-      $parameters[RouteObjectInterface::ROUTE_OBJECT] = $object;
60
+        $object = $name;
61
+        $name = RouteObjectInterface::OBJECT_BASED_ROUTE_NAME;
62
+        $parameters[RouteObjectInterface::ROUTE_OBJECT] = $object;
63 63
     }
64 64
 
65 65
     try {
66
-      return $this->routingExtension->getUrl($name, $parameters, $schemeRelative);
66
+        return $this->routingExtension->getUrl($name, $parameters, $schemeRelative);
67 67
     } catch (RouteNotFoundException|MissingMandatoryParametersException|InvalidParameterException $e) {
68
-      // allow empty url
68
+        // allow empty url
69 69
     }
70 70
 
71 71
     return null;
72
-  }
72
+    }
73 73
 
74
-  public function getFunctions(): array {
74
+    public function getFunctions(): array {
75 75
     return [
76 76
         new TwigFunction('url', [$this, 'getUrl'], ['is_safe_callback' => [$this->routingExtension, 'isUrlGenerationSafe']]),
77 77
         new TwigFunction('path', [$this, 'getPath'], ['is_safe_callback' => [$this->routingExtension, 'isUrlGenerationSafe']]),
78 78
     ];
79
-  }
79
+    }
80 80
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Routing/MetaRouter.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
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
   /**
Please login to merge, or discard this patch.
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -24,41 +24,41 @@  discard block
 block discarded – undo
24 24
 use Symfony\Component\Routing\Route as SymfonyRoute;
25 25
 
26 26
 class MetaRouter extends DynamicRouter {
27
-  protected $internalRoutesCache = [];
27
+    protected $internalRoutesCache = [];
28 28
 
29
-  public function generate($name, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) {
29
+    public function generate($name, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) {
30 30
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $name
31 31
         && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)
32 32
     ) {
33
-      $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
34
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
33
+        $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
34
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
35 35
     }
36 36
 
37 37
     $cacheKey = $this->getCacheKey($name, $parameters, $referenceType);
38 38
     if (array_key_exists($cacheKey, $this->internalRoutesCache)) {
39
-      return $this->internalRoutesCache[$cacheKey];
39
+        return $this->internalRoutesCache[$cacheKey];
40 40
     }
41 41
 
42 42
     $route = $name;
43 43
     if ($name instanceof Meta) {
44
-      $object = $name->getValues();
45
-      if ($object instanceof ArticleInterface) {
44
+        $object = $name->getValues();
45
+        if ($object instanceof ArticleInterface) {
46 46
         $parameters['slug'] = $object->getSlug();
47 47
         $route = $object->getRoute();
48 48
         if (null === $route && $name->getContext()->getCurrentPage()) {
49
-          $parameters['slug'] = null;
50
-          $route = $name->getContext()->getCurrentPage()->getValues();
49
+            $parameters['slug'] = null;
50
+            $route = $name->getContext()->getCurrentPage()->getValues();
51 51
         }
52
-      } elseif ($name->getValues() instanceof RouteInterface) {
52
+        } elseif ($name->getValues() instanceof RouteInterface) {
53 53
         $route = $name->getValues();
54
-      }
54
+        }
55 55
     } elseif ($name instanceof ArticleInterface) {
56
-      $route = $name->getRoute();
57
-      $parameters['slug'] = $name->getSlug();
56
+        $route = $name->getRoute();
57
+        $parameters['slug'] = $name->getSlug();
58 58
     }
59 59
 
60 60
     if (null === $route || is_array($route)) {
61
-      throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name));
61
+        throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name));
62 62
     }
63 63
 
64 64
     $result = parent::generate($route, $parameters, $referenceType);
@@ -66,29 +66,29 @@  discard block
 block discarded – undo
66 66
     unset($route);
67 67
 
68 68
     return $result;
69
-  }
69
+    }
70 70
 
71
-  private function getCacheKey($route, $parameters, $type) {
71
+    private function getCacheKey($route, $parameters, $type) {
72 72
     $name = $route;
73 73
     if ($route instanceof Meta) {
74
-      if ($route->getValues() instanceof ArticleInterface) {
74
+        if ($route->getValues() instanceof ArticleInterface) {
75 75
         $name = $route->getValues()->getId();
76
-      } elseif ($route->getValues() instanceof RouteInterface) {
76
+        } elseif ($route->getValues() instanceof RouteInterface) {
77 77
         $name = $route->getValues()->getName();
78
-      }
78
+        }
79 79
     } elseif ($route instanceof RouteInterface) {
80
-      $name = $route->getName();
80
+        $name = $route->getName();
81 81
     } elseif ($route instanceof ArticleInterface) {
82
-      $name = $route->getId();
82
+        $name = $route->getId();
83 83
     }
84 84
 
85 85
     return md5($name . serialize($parameters) . $type);
86
-  }
86
+    }
87 87
 
88
-  /**
89
-   * {@inheritdoc}
90
-   */
91
-  public function supports($name) {
88
+    /**
89
+     * {@inheritdoc}
90
+     */
91
+    public function supports($name) {
92 92
     return
93 93
         ($name instanceof Meta && (
94 94
                 $name->getValues() instanceof ArticleInterface ||
@@ -103,5 +103,5 @@  discard block
 block discarded – undo
103 103
             'swp_media_get' !== $name &&
104 104
             false === strpos($name, 'swp_api_')
105 105
         );
106
-  }
106
+    }
107 107
 }
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Command/ProcessPackagesCommand.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,8 +123,8 @@
 block discarded – undo
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()));
Please login to merge, or discard this patch.
src/SWP/Bundle/MultiTenancyBundle/Routing/TenantAwareRouter.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,12 +31,12 @@
 block discarded – undo
31 31
      */
32 32
     public function generate($name, $parameters = [], $referenceType = false)
33 33
     {
34
-      if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $name
34
+        if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $name
35 35
           && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)
36
-      ) {
36
+        ) {
37 37
         $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
38 38
         unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
39
-      }
39
+        }
40 40
 
41 41
         if (null === $name && isset($parameters['content_id'])) {
42 42
             $contentId = $this->checkAndRemoveFirstSlash($parameters['content_id']);
Please login to merge, or discard this patch.
src/SWP/Bundle/ContentBundle/Routing/MediaRouter.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
       $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT];
53 53
       unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
54 54
     }
55
-    return 'Route for media ' . $meta->getValues()->getId() . ' not found';
55
+    return 'Route for media '.$meta->getValues()->getId().' not found';
56 56
   }
57 57
 
58 58
   public function supports($meta): bool {
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         true === $parameters['webp'] &&
114 114
         $item->hasVariant(ImageInterface::VARIANT_WEBP)
115 115
     ) {
116
-      return str_replace('.' . $item->getFileExtension(), '.webp', $url);
116
+      return str_replace('.'.$item->getFileExtension(), '.webp', $url);
117 117
     }
118 118
 
119 119
     return $url;
Please login to merge, or discard this patch.
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -31,80 +31,80 @@  discard block
 block discarded – undo
31 31
 use Symfony\Component\Routing\RequestContext;
32 32
 
33 33
 class MediaRouter extends Router implements VersatileGeneratorInterface {
34
-  private $mediaManager;
35
-
36
-  public function __construct(
37
-      ContainerInterface $container,
38
-                         $resource,
39
-      array              $options = [],
40
-      RequestContext     $context = null,
41
-      ContainerInterface $parameters = null,
42
-      LoggerInterface    $logger = null,
43
-      string             $defaultLocale = null
44
-  ) {
34
+    private $mediaManager;
35
+
36
+    public function __construct(
37
+        ContainerInterface $container,
38
+                            $resource,
39
+        array              $options = [],
40
+        RequestContext     $context = null,
41
+        ContainerInterface $parameters = null,
42
+        LoggerInterface    $logger = null,
43
+        string             $defaultLocale = null
44
+    ) {
45 45
     $this->mediaManager = $container->get('swp_content_bundle.manager.media');
46 46
 
47 47
     parent::__construct($container, $resource, $options, $context, $parameters, $logger, $defaultLocale);
48
-  }
48
+    }
49 49
 
50
-  public function getRouteDebugMessage($meta, array $parameters = array()): string {
50
+    public function getRouteDebugMessage($meta, array $parameters = array()): string {
51 51
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $meta && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)) {
52
-      $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT];
53
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
52
+        $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT];
53
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
54 54
     }
55 55
     return 'Route for media ' . $meta->getValues()->getId() . ' not found';
56
-  }
56
+    }
57 57
 
58
-  public function supports($meta): bool {
58
+    public function supports($meta): bool {
59 59
     return  $meta instanceof Meta && (
60 60
             $meta->getValues() instanceof ArticleMediaInterface ||
61 61
             $meta->getValues() instanceof ImageRenditionInterface
62 62
         );
63
-  }
63
+    }
64 64
 
65
-  public function generate($meta, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string {
65
+    public function generate($meta, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string {
66 66
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $meta && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)) {
67
-      $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT];
68
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
67
+        $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT];
68
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
69 69
     }
70 70
 
71 71
     if (!$meta instanceof Meta) {
72
-      return '';
72
+        return '';
73 73
     }
74 74
 
75 75
     $item = $this->getItem($meta);
76 76
     if (null === $item) {
77
-      return '';
77
+        return '';
78 78
     }
79 79
 
80 80
     if ($meta->getValues() instanceof ImageRenditionInterface && null !== ($previewUrl = $meta->getValues()->getPreviewUrl())) {
81
-      return $previewUrl;
81
+        return $previewUrl;
82 82
     }
83 83
 
84 84
     if ($item instanceof PreviewUrlAwareInterface && null !== ($previewUrl = $item->getPreviewUrl())) {
85
-      return $previewUrl;
85
+        return $previewUrl;
86 86
     }
87 87
 
88 88
     return $this->getUrlWithCorrectExtension($item, $parameters);
89
-  }
89
+    }
90 90
 
91
-  private function getItem(Meta $meta): ?FileInterface {
91
+    private function getItem(Meta $meta): ?FileInterface {
92 92
     if (($rendition = $meta->getValues()) instanceof ImageRendition) {
93
-      return $rendition->getImage();
93
+        return $rendition->getImage();
94 94
     }
95 95
 
96 96
     if (($image = $meta->getValues()->getImage()) instanceof ImageInterface) {
97
-      return $image;
97
+        return $image;
98 98
     }
99 99
 
100 100
     if (($file = $meta->getValues()->getFile()) instanceof FileInterface) {
101
-      return $file;
101
+        return $file;
102 102
     }
103 103
 
104 104
     return null;
105
-  }
105
+    }
106 106
 
107
-  private function getUrlWithCorrectExtension(FileInterface $item, array $parameters): string {
107
+    private function getUrlWithCorrectExtension(FileInterface $item, array $parameters): string {
108 108
     $url = $this->mediaManager->getMediaPublicUrl($item);
109 109
 
110 110
     if (
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
         true === $parameters['webp'] &&
114 114
         $item->hasVariant(ImageInterface::VARIANT_WEBP)
115 115
     ) {
116
-      return str_replace('.' . $item->getFileExtension(), '.webp', $url);
116
+        return str_replace('.' . $item->getFileExtension(), '.webp', $url);
117 117
     }
118 118
 
119 119
     return $url;
120
-  }
120
+    }
121 121
 }
Please login to merge, or discard this patch.