@@ -161,7 +161,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -39,10 +39,10 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -74,17 +74,17 @@ |
||
| 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 | } |
@@ -38,7 +38,7 @@ |
||
| 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 | { |
@@ -85,7 +85,7 @@ |
||
| 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 | } |
@@ -17,7 +17,6 @@ |
||
| 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; |
@@ -77,7 +77,7 @@ |
||
| 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 | */ |
@@ -196,7 +196,7 @@ |
||
| 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 | } |
@@ -20,6 +20,7 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | /** |
| 22 | 22 | * @param string $name |
| 23 | + * @return void |
|
| 23 | 24 | */ |
| 24 | 25 | public function setName($name); |
| 25 | 26 | |
@@ -60,6 +61,7 @@ discard block |
||
| 60 | 61 | |
| 61 | 62 | /** |
| 62 | 63 | * @param array $settings |
| 64 | + * @return void |
|
| 63 | 65 | */ |
| 64 | 66 | public function setSettings(array $settings): void; |
| 65 | 67 | |
@@ -70,6 +72,7 @@ discard block |
||
| 70 | 72 | |
| 71 | 73 | /** |
| 72 | 74 | * @param \SplFileInfo|null $file |
| 75 | + * @return void |
|
| 73 | 76 | */ |
| 74 | 77 | public function setLogo(?\SplFileInfo $file): void; |
| 75 | 78 | |
@@ -85,6 +88,7 @@ discard block |
||
| 85 | 88 | |
| 86 | 89 | /** |
| 87 | 90 | * @param string|null $path |
| 91 | + * @return void |
|
| 88 | 92 | */ |
| 89 | 93 | public function setLogoPath(?string $path): void; |
| 90 | 94 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | $routeNodeDefinition = $routesNodeDefinition->prototype('array'); |
| 143 | 143 | $routeNodeDefinition |
| 144 | 144 | ->validate() |
| 145 | - ->ifTrue(function ($route) { |
|
| 145 | + ->ifTrue(function($route) { |
|
| 146 | 146 | return [] === $route; |
| 147 | 147 | }) |
| 148 | 148 | ->thenInvalid('Route cannot be empty!') |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $menuNodeDefinition = $menusNodeDefinition->prototype('array'); |
| 171 | 171 | $menuNodeDefinition |
| 172 | 172 | ->validate() |
| 173 | - ->ifTrue(function ($menu) { |
|
| 173 | + ->ifTrue(function($menu) { |
|
| 174 | 174 | return [] === $menu; |
| 175 | 175 | }) |
| 176 | 176 | ->thenInvalid('Menu cannot be empty!') |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | $childrenNodeDefinition = $childrensNodeDefinition->prototype('array'); |
| 189 | 189 | $childrenNodeDefinition |
| 190 | 190 | ->validate() |
| 191 | - ->ifTrue(function ($menu) { |
|
| 191 | + ->ifTrue(function($menu) { |
|
| 192 | 192 | return [] === $menu; |
| 193 | 193 | }) |
| 194 | 194 | ->thenInvalid('Menu cannot be empty!') |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | $childrensChildrenNodeDefinition = $childrensChildrensNodeDefinition->prototype('array'); |
| 207 | 207 | $childrensChildrenNodeDefinition |
| 208 | 208 | ->validate() |
| 209 | - ->ifTrue(function ($menu) { |
|
| 209 | + ->ifTrue(function($menu) { |
|
| 210 | 210 | return [] === $menu; |
| 211 | 211 | }) |
| 212 | 212 | ->thenInvalid('Menu cannot be empty!') |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | $containerNodeDefinition = $containersNodeDefinition->prototype('array'); |
| 232 | 232 | $containerNodeDefinition |
| 233 | 233 | ->validate() |
| 234 | - ->ifTrue(function ($widget) { |
|
| 234 | + ->ifTrue(function($widget) { |
|
| 235 | 235 | return [] === $widget; |
| 236 | 236 | }) |
| 237 | 237 | ->thenInvalid('Widget cannot be empty!') |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | $containerNodeDefinition = $containersNodeDefinition->prototype('array'); |
| 255 | 255 | $containerNodeDefinition |
| 256 | 256 | ->validate() |
| 257 | - ->ifTrue(function ($widget) { |
|
| 257 | + ->ifTrue(function($widget) { |
|
| 258 | 258 | return [] === $widget; |
| 259 | 259 | }) |
| 260 | 260 | ->thenInvalid('Content List cannot be empty!') |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $widgetNodeDefinition = $widgetsNodeDefinition->prototype('array'); |
| 279 | 279 | $widgetNodeDefinition |
| 280 | 280 | ->validate() |
| 281 | - ->ifTrue(function ($widget) { |
|
| 281 | + ->ifTrue(function($widget) { |
|
| 282 | 282 | return [] === $widget; |
| 283 | 283 | }) |
| 284 | 284 | ->thenInvalid('Widget cannot be empty!') |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | $screenshotNodeDefinition |
| 310 | 310 | ->validate() |
| 311 | - ->ifTrue(function ($screenshot) { |
|
| 311 | + ->ifTrue(function($screenshot) { |
|
| 312 | 312 | return [] === $screenshot || ['path' => ''] === $screenshot; |
| 313 | 313 | }) |
| 314 | 314 | ->thenInvalid('Screenshot cannot be empty!') |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $screenshotNodeDefinition |
| 317 | 317 | ->beforeNormalization() |
| 318 | 318 | ->ifString() |
| 319 | - ->then(function ($value) { |
|
| 319 | + ->then(function($value) { |
|
| 320 | 320 | return ['path' => $value]; |
| 321 | 321 | }) |
| 322 | 322 | ; |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $authorNodeDefinition = $authorsNodeDefinition->prototype('array'); |
| 343 | 343 | $authorNodeDefinition |
| 344 | 344 | ->validate() |
| 345 | - ->ifTrue(function ($author) { |
|
| 345 | + ->ifTrue(function($author) { |
|
| 346 | 346 | return [] === $author; |
| 347 | 347 | }) |
| 348 | 348 | ->thenInvalid('Author cannot be empty!') |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | $settingNodeDefinition = $settingsNodeDefinition->prototype('array'); |
| 371 | 371 | $settingNodeDefinition |
| 372 | 372 | ->validate() |
| 373 | - ->ifTrue(function ($setting) { |
|
| 373 | + ->ifTrue(function($setting) { |
|
| 374 | 374 | return [] === $setting; |
| 375 | 375 | }) |
| 376 | 376 | ->thenInvalid('Setting cannot be empty!') |