Completed
Pull Request — master (#1218)
by
unknown
44s
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/MediaRouter.php 2 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -32,77 +32,77 @@  discard block
 block discarded – undo
32 32
 use Symfony\Component\Routing\Route as SymfonyRoute;
33 33
 
34 34
 class MediaRouter extends Router implements VersatileGeneratorInterface {
35
-  private $mediaManager;
36
-
37
-  public function __construct(
38
-      ContainerInterface $container,
39
-                         $resource,
40
-      array              $options = [],
41
-      RequestContext     $context = null,
42
-      ContainerInterface $parameters = null,
43
-      LoggerInterface    $logger = null,
44
-      string             $defaultLocale = null
45
-  ) {
35
+    private $mediaManager;
36
+
37
+    public function __construct(
38
+        ContainerInterface $container,
39
+                            $resource,
40
+        array              $options = [],
41
+        RequestContext     $context = null,
42
+        ContainerInterface $parameters = null,
43
+        LoggerInterface    $logger = null,
44
+        string             $defaultLocale = null
45
+    ) {
46 46
     $this->mediaManager = $container->get('swp_content_bundle.manager.media');
47 47
 
48 48
     parent::__construct($container, $resource, $options, $context, $parameters, $logger, $defaultLocale);
49
-  }
49
+    }
50 50
 
51
-  public function getRouteDebugMessage($meta, array $parameters = array()): string {
51
+    public function getRouteDebugMessage($meta, array $parameters = array()): string {
52 52
     return 'Route for media ' . $meta->getValues()->getId() . ' not found';
53
-  }
53
+    }
54 54
 
55
-  public function supports($meta): bool {
55
+    public function supports($meta): bool {
56 56
     return $meta instanceof Meta && (
57 57
             $meta->getValues() instanceof ArticleMediaInterface ||
58 58
             $meta->getValues() instanceof ImageRenditionInterface
59 59
         );
60
-  }
60
+    }
61 61
 
62
-  public function generate($meta, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string {
62
+    public function generate($meta, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH): string {
63 63
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $meta
64 64
         && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)
65 65
         && $parameters[RouteObjectInterface::ROUTE_OBJECT] instanceof SymfonyRoute
66 66
     ) {
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
 
105
-  private function getUrlWithCorrectExtension(FileInterface $item, array $parameters): string {
105
+    private function getUrlWithCorrectExtension(FileInterface $item, array $parameters): string {
106 106
     $url = $this->mediaManager->getMediaPublicUrl($item);
107 107
 
108 108
     if (
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
         true === $parameters['webp'] &&
112 112
         $item->hasVariant(ImageInterface::VARIANT_WEBP)
113 113
     ) {
114
-      return str_replace('.' . $item->getFileExtension(), '.webp', $url);
114
+        return str_replace('.' . $item->getFileExtension(), '.webp', $url);
115 115
     }
116 116
 
117 117
     return $url;
118
-  }
118
+    }
119 119
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
   }
50 50
 
51 51
   public function getRouteDebugMessage($meta, array $parameters = array()): string {
52
-    return 'Route for media ' . $meta->getValues()->getId() . ' not found';
52
+    return 'Route for media '.$meta->getValues()->getId().' not found';
53 53
   }
54 54
 
55 55
   public function supports($meta): bool {
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         true === $parameters['webp'] &&
112 112
         $item->hasVariant(ImageInterface::VARIANT_WEBP)
113 113
     ) {
114
-      return str_replace('.' . $item->getFileExtension(), '.webp', $url);
114
+      return str_replace('.'.$item->getFileExtension(), '.webp', $url);
115 115
     }
116 116
 
117 117
     return $url;
Please login to merge, or discard this patch.
src/SWP/Bundle/ContentBundle/Routing/SeoMediaRouter.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,31 +25,31 @@
 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
     $item = $name->getValues()->getImage();
33 33
 
34 34
     $parameters['mediaId'] = $item->getAssetId();
35 35
     $parameters['extension'] = $item->getFileExtension();
36 36
 
37 37
     return parent::generate('swp_seo_media_get', $parameters, $referenceType);
38
-  }
38
+    }
39 39
 
40
-  public function supports($name): bool {
40
+    public function supports($name): bool {
41 41
     return $name instanceof Meta && $name->getValues() instanceof ArticleSeoMediaInterface;
42
-  }
42
+    }
43 43
 
44
-  public function getRouteDebugMessage($name, array $parameters = array()): string {
44
+    public function getRouteDebugMessage($name, array $parameters = array()): string {
45 45
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $name
46 46
         && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)
47 47
         && $parameters[RouteObjectInterface::ROUTE_OBJECT] instanceof SymfonyRoute
48 48
     ) {
49
-      $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
50
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
49
+        $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
50
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
51 51
     }
52 52
 
53 53
     return 'Route for media ' . $name->getValues()->getId() . ' not found';
54
-  }
54
+    }
55 55
 }
Please login to merge, or discard this patch.
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.
src/SWP/Bundle/MultiTenancyBundle/Routing/TenantAwareRouter.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@
 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
           && $parameters[RouteObjectInterface::ROUTE_OBJECT] instanceof SymfonyRoute
37
-      ) {
37
+        ) {
38 38
         $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
39 39
         unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
40
-      }
40
+        }
41 41
 
42 42
         if (null === $name && isset($parameters['content_id'])) {
43 43
             $contentId = $this->checkAndRemoveFirstSlash($parameters['content_id']);
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
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -24,42 +24,42 @@  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
         && $parameters[RouteObjectInterface::ROUTE_OBJECT] instanceof SymfonyRoute
33 33
     ) {
34
-      $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
35
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
34
+        $name = $parameters[RouteObjectInterface::ROUTE_OBJECT];
35
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
36 36
     }
37 37
 
38 38
     $cacheKey = $this->getCacheKey($name, $parameters, $referenceType);
39 39
     if (array_key_exists($cacheKey, $this->internalRoutesCache)) {
40
-      return $this->internalRoutesCache[$cacheKey];
40
+        return $this->internalRoutesCache[$cacheKey];
41 41
     }
42 42
 
43 43
     $route = $name;
44 44
     if ($name instanceof Meta) {
45
-      $object = $name->getValues();
46
-      if ($object instanceof ArticleInterface) {
45
+        $object = $name->getValues();
46
+        if ($object instanceof ArticleInterface) {
47 47
         $parameters['slug'] = $object->getSlug();
48 48
         $route = $object->getRoute();
49 49
         if (null === $route && $name->getContext()->getCurrentPage()) {
50
-          $parameters['slug'] = null;
51
-          $route = $name->getContext()->getCurrentPage()->getValues();
50
+            $parameters['slug'] = null;
51
+            $route = $name->getContext()->getCurrentPage()->getValues();
52 52
         }
53
-      } elseif ($name->getValues() instanceof RouteInterface) {
53
+        } elseif ($name->getValues() instanceof RouteInterface) {
54 54
         $route = $name->getValues();
55
-      }
55
+        }
56 56
     } elseif ($name instanceof ArticleInterface) {
57
-      $route = $name->getRoute();
58
-      $parameters['slug'] = $name->getSlug();
57
+        $route = $name->getRoute();
58
+        $parameters['slug'] = $name->getSlug();
59 59
     }
60 60
 
61 61
     if (null === $route || is_array($route)) {
62
-      throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name));
62
+        throw new RouteNotFoundException(sprintf('Unable to generate a URL for the named route "%s" as such route does not exist.', $name));
63 63
     }
64 64
 
65 65
     $result = parent::generate($route, $parameters, $referenceType);
@@ -67,29 +67,29 @@  discard block
 block discarded – undo
67 67
     unset($route);
68 68
 
69 69
     return $result;
70
-  }
70
+    }
71 71
 
72
-  private function getCacheKey($route, $parameters, $type) {
72
+    private function getCacheKey($route, $parameters, $type) {
73 73
     $name = $route;
74 74
     if ($route instanceof Meta) {
75
-      if ($route->getValues() instanceof ArticleInterface) {
75
+        if ($route->getValues() instanceof ArticleInterface) {
76 76
         $name = $route->getValues()->getId();
77
-      } elseif ($route->getValues() instanceof RouteInterface) {
77
+        } elseif ($route->getValues() instanceof RouteInterface) {
78 78
         $name = $route->getValues()->getName();
79
-      }
79
+        }
80 80
     } elseif ($route instanceof RouteInterface) {
81
-      $name = $route->getName();
81
+        $name = $route->getName();
82 82
     } elseif ($route instanceof ArticleInterface) {
83
-      $name = $route->getId();
83
+        $name = $route->getId();
84 84
     }
85 85
 
86 86
     return md5($name . serialize($parameters) . $type);
87
-  }
87
+    }
88 88
 
89
-  /**
90
-   * {@inheritdoc}
91
-   */
92
-  public function supports($name) {
89
+    /**
90
+     * {@inheritdoc}
91
+     */
92
+    public function supports($name) {
93 93
     return
94 94
         ($name instanceof Meta && (
95 95
                 $name->getValues() instanceof ArticleInterface ||
@@ -104,5 +104,5 @@  discard block
 block discarded – undo
104 104
             'swp_media_get' !== $name &&
105 105
             false === strpos($name, 'swp_api_')
106 106
         );
107
-  }
107
+    }
108 108
 }
Please login to merge, or discard this patch.
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.
src/SWP/Bundle/CoreBundle/Routing/ArticleAuthorMediaRouter.php 2 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -26,46 +26,46 @@
 block discarded – undo
26 26
 use Symfony\Component\Routing\Route as SymfonyRoute;
27 27
 
28 28
 class ArticleAuthorMediaRouter extends Router implements VersatileGeneratorInterface {
29
-  protected $authorMediaManager;
29
+    protected $authorMediaManager;
30 30
 
31
-  public function __construct(
32
-      ContainerInterface $container,
33
-                         $resource,
34
-      array              $options = [],
35
-      RequestContext     $context = null,
36
-      ContainerInterface $parameters = null,
37
-      LoggerInterface    $logger = null,
38
-      string             $defaultLocale = null
39
-  ) {
31
+    public function __construct(
32
+        ContainerInterface $container,
33
+                            $resource,
34
+        array              $options = [],
35
+        RequestContext     $context = null,
36
+        ContainerInterface $parameters = null,
37
+        LoggerInterface    $logger = null,
38
+        string             $defaultLocale = null
39
+    ) {
40 40
     $this->authorMediaManager = $container->get('swp_core_bundle.manager.author_media');
41 41
 
42 42
     parent::__construct($container, $resource, $options, $context, $parameters, $logger, $defaultLocale);
43
-  }
43
+    }
44 44
 
45
-  public function generate($meta, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) {
45
+    public function generate($meta, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH) {
46 46
     if (RouteObjectInterface::OBJECT_BASED_ROUTE_NAME === $meta
47 47
         && array_key_exists(RouteObjectInterface::ROUTE_OBJECT, $parameters)
48 48
         && $parameters[RouteObjectInterface::ROUTE_OBJECT] instanceof SymfonyRoute
49 49
     ) {
50
-      $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT];
51
-      unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
50
+        $meta = $parameters[RouteObjectInterface::ROUTE_OBJECT];
51
+        unset($parameters[RouteObjectInterface::ROUTE_OBJECT]);
52 52
     }
53 53
 
54 54
     if ($meta instanceof Meta && ($meta->getValues() instanceof AuthorMediaInterface)) {
55
-      return $this->authorMediaManager->getMediaPublicUrl($meta->getValues()->getImage());
55
+        return $this->authorMediaManager->getMediaPublicUrl($meta->getValues()->getImage());
56 56
     }
57 57
 
58 58
     return '';
59
-  }
59
+    }
60 60
 
61
-  /**
62
-   * {@inheritdoc}
63
-   */
64
-  public function supports($name) {
61
+    /**
62
+     * {@inheritdoc}
63
+     */
64
+    public function supports($name) {
65 65
     return $name instanceof Meta && ($name->getValues() instanceof AuthorMediaInterface);
66
-  }
66
+    }
67 67
 
68
-  public function getRouteDebugMessage($name, array $parameters = []) {
68
+    public function getRouteDebugMessage($name, array $parameters = []) {
69 69
     return 'Route for article author media ' . $name->getValues()->getId() . ' not found';
70
-  }
70
+    }
71 71
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,6 +66,6 @@
 block discarded – undo
66 66
   }
67 67
 
68 68
   public function getRouteDebugMessage($name, array $parameters = []) {
69
-    return 'Route for article author media ' . $name->getValues()->getId() . ' not found';
69
+    return 'Route for article author media '.$name->getValues()->getId().' not found';
70 70
   }
71 71
 }
Please login to merge, or discard this patch.