Completed
Pull Request — 1.4 (#727)
by Paweł
10:20
created
src/SWP/Bundle/CoreBundle/Theme/Loader/TenantAwareThemeLoader.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     {
162 162
         $tenantCode = substr($themeName, strpos($themeName, '@') + 1);
163 163
 
164
-        return array_map(function ($parentName) use ($themeName, $existingThemes, $tenantCode) {
164
+        return array_map(function($parentName) use ($themeName, $existingThemes, $tenantCode) {
165 165
             $parentName .= '@'.$tenantCode;
166 166
             if (!isset($existingThemes[$parentName])) {
167 167
                 throw new ThemeLoadingFailedException(sprintf(
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
      */
183 183
     private function convertAuthorsArraysToAuthorsObjects(array $authorsArrays)
184 184
     {
185
-        return array_map(function (array $authorArray) {
185
+        return array_map(function(array $authorArray) {
186 186
             return $this->themeAuthorFactory->createFromArray($authorArray);
187 187
         }, $authorsArrays);
188 188
     }
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
      */
195 195
     private function convertScreenshotsArraysToScreenshotsObjects(array $screenshotsArrays)
196 196
     {
197
-        return array_map(function (array $screenshotArray) {
197
+        return array_map(function(array $screenshotArray) {
198 198
             return $this->themeScreenshotFactory->createFromArray($screenshotArray);
199 199
         }, $screenshotsArrays);
200 200
     }
Please login to merge, or discard this patch.
src/SWP/Bundle/TemplatesSystemBundle/Form/Type/WidgetType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
 
40 40
         $builder->get('visible')
41 41
             ->addModelTransformer(new CallbackTransformer(
42
-                function ($value) {
42
+                function($value) {
43 43
                     return $value;
44 44
                 },
45
-                function ($value) {
45
+                function($value) {
46 46
                     if (is_bool($value) || in_array($value, ['true', 'false', '1', '0', null])) {
47 47
                         return filter_var($value, FILTER_VALIDATE_BOOLEAN);
48 48
                     }
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
 
54 54
         $builder->get('parameters')
55 55
             ->addModelTransformer(new CallbackTransformer(
56
-                function ($value) {
56
+                function($value) {
57 57
                     if (is_array($value) && !empty($value)) {
58 58
                         return json_encode($value);
59 59
                     }
60 60
 
61 61
                     return $value;
62 62
                 },
63
-                function ($value) {
63
+                function($value) {
64 64
                     if (is_string($value)) {
65 65
                         return json_decode($value, true);
66 66
                     }
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Serializer/TenantHandler.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -74,17 +74,17 @@
 block discarded – undo
74 74
         }
75 75
 
76 76
         return [
77
-           'id' => $tenant->getId(),
78
-           'subdomain' => $tenant->getSubdomain(),
79
-           'domainName' => $tenant->getDomainName(),
80
-           'code' => $tenantCode,
81
-           'name' => $tenant->getName(),
82
-           'ampEnabled' => $tenant->isAmpEnabled(),
77
+            'id' => $tenant->getId(),
78
+            'subdomain' => $tenant->getSubdomain(),
79
+            'domainName' => $tenant->getDomainName(),
80
+            'code' => $tenantCode,
81
+            'name' => $tenant->getName(),
82
+            'ampEnabled' => $tenant->isAmpEnabled(),
83 83
             '_links' => [
84 84
                 'self' => [
85 85
                     'href' => $this->router->generate('swp_api_core_get_tenant', ['code' => $tenantCode]),
86 86
                 ],
87 87
             ],
88
-       ];
88
+        ];
89 89
     }
90 90
 }
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Factory/ApiKeyFactory.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
      * @param UserInterface $user
39 39
      * @param string|null   $apiKeyValue
40 40
      *
41
-     * @return mixed
41
+     * @return ApiKeyInterface
42 42
      */
43 43
     public function create($user, $apiKeyValue = null)
44 44
     {
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Controller/ThemesController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
         $currentTheme = $tenant->getThemeName();
86 86
         $themes = array_filter(
87 87
             $this->get('sylius.repository.theme')->findAll(),
88
-            function ($element) use (&$tenantCode, $currentTheme) {
88
+            function($element) use (&$tenantCode, $currentTheme) {
89 89
                 if (strpos($element->getName(), ThemeHelper::SUFFIX_SEPARATOR.$tenantCode)) {
90 90
                     return true;
91 91
                 }
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,6 @@
 block discarded – undo
17 17
 use Knp\Component\Pager\Pagination\SlidingPagination;
18 18
 use SWP\Bundle\CoreBundle\Form\Type\ThemeInstallType;
19 19
 use SWP\Bundle\CoreBundle\Form\Type\ThemeUploadType;
20
-use SWP\Bundle\CoreBundle\Model\Tenant;
21 20
 use SWP\Bundle\CoreBundle\Model\TenantInterface;
22 21
 use SWP\Bundle\CoreBundle\Theme\Helper\ThemeHelper;
23 22
 use SWP\Component\Common\Response\ResponseContext;
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Theme/Generator/ThemeContainersGenerator.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
     /**
78 78
      * @param array $containerData
79 79
      *
80
-     * @return mixed
80
+     * @return null|\SWP\Component\TemplatesSystem\Gimme\Model\ContainerInterface
81 81
      *
82 82
      * @throws \Exception
83 83
      */
Please login to merge, or discard this patch.
src/SWP/Bundle/ContentBundle/Provider/ORM/RouteProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
      */
197 197
     private function getArrayOfIdsFromRoutesArray(array $routes): array
198 198
     {
199
-        return array_map(function ($route) {
199
+        return array_map(function($route) {
200 200
             return $route->getId();
201 201
         }, $routes);
202 202
     }
Please login to merge, or discard this patch.
src/SWP/Component/TemplatesSystem/Twig/Extension/GimmeExtension.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -76,22 +76,22 @@
 block discarded – undo
76 76
     public function getFilters()
77 77
     {
78 78
         return [
79
-            new \Twig_SimpleFilter('start', function ($node, $value) {
79
+            new \Twig_SimpleFilter('start', function($node, $value) {
80 80
                 $node['_collection_type_filters']['start'] = $value;
81 81
 
82 82
                 return $node;
83 83
             }, ['needs_context' => false]),
84
-            new \Twig_SimpleFilter('limit', function ($node, $value) {
84
+            new \Twig_SimpleFilter('limit', function($node, $value) {
85 85
                 $node['_collection_type_filters']['limit'] = $value;
86 86
 
87 87
                 return $node;
88 88
             }, ['needs_context' => false]),
89
-            new \Twig_SimpleFilter('order', function ($node, $value1, $value2) {
89
+            new \Twig_SimpleFilter('order', function($node, $value1, $value2) {
90 90
                 $node['_collection_type_filters']['order'] = [$value1, $value2];
91 91
 
92 92
                 return $node;
93 93
             }, ['needs_context' => false]),
94
-            new \Twig_SimpleFilter('dateRange', function ($node, $value1, $value2) {
94
+            new \Twig_SimpleFilter('dateRange', function($node, $value1, $value2) {
95 95
                 $node['_collection_type_filters']['date_range'] = [$value1, $value2];
96 96
 
97 97
                 return $node;
Please login to merge, or discard this patch.
src/SWP/Bundle/CoreBundle/Theme/Model/ThemeInterface.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -21,6 +21,7 @@  discard block
 block discarded – undo
21 21
 {
22 22
     /**
23 23
      * @param string $name
24
+     * @return void
24 25
      */
25 26
     public function setName($name);
26 27
 
@@ -61,6 +62,7 @@  discard block
 block discarded – undo
61 62
 
62 63
     /**
63 64
      * @param array $settings
65
+     * @return void
64 66
      */
65 67
     public function setSettings(array $settings): void;
66 68
 
@@ -71,6 +73,7 @@  discard block
 block discarded – undo
71 73
 
72 74
     /**
73 75
      * @param \SplFileInfo|null $file
76
+     * @return void
74 77
      */
75 78
     public function setLogo(?\SplFileInfo $file): void;
76 79
 
@@ -86,6 +89,7 @@  discard block
 block discarded – undo
86 89
 
87 90
     /**
88 91
      * @param string|null $path
92
+     * @return void
89 93
      */
90 94
     public function setLogoPath(?string $path): void;
91 95
 }
Please login to merge, or discard this patch.