@@ -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 | } |
@@ -41,6 +41,10 @@ discard block |
||
| 41 | 41 | $manager->flush(); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | + /** |
|
| 45 | + * @param string $env |
|
| 46 | + * @param ObjectManager $manager |
|
| 47 | + */ |
|
| 44 | 48 | public function loadRoutes($env, $manager) |
| 45 | 49 | { |
| 46 | 50 | $routes = [ |
@@ -195,6 +199,7 @@ discard block |
||
| 195 | 199 | /** |
| 196 | 200 | * Sets articles manually (not via Alice) for test env due to fatal error: |
| 197 | 201 | * Method PHPCRProxies\__CG__\Doctrine\ODM\PHPCR\Document\Generic::__toString() must not throw an exception. |
| 202 | + * @param string $env |
|
| 198 | 203 | */ |
| 199 | 204 | public function loadArticles($env, ObjectManager $manager) |
| 200 | 205 | { |
@@ -446,6 +451,10 @@ discard block |
||
| 446 | 451 | ]; |
| 447 | 452 | } |
| 448 | 453 | |
| 454 | + /** |
|
| 455 | + * @param string $fakeImage |
|
| 456 | + * @param string $targetFile |
|
| 457 | + */ |
|
| 449 | 458 | private function cropAndResizeImage($fakeImage, array $rendition, $targetFile) |
| 450 | 459 | { |
| 451 | 460 | $image = imagecreatefromjpeg($fakeImage); |
@@ -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; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | /** |
| 56 | 56 | * Loads Alice fixtures. |
| 57 | 57 | * |
| 58 | - * @param array|string $paths Fixtures path(s) |
|
| 58 | + * @param string[] $paths Fixtures path(s) |
|
| 59 | 59 | * @param ObjectManager $manager Object manager |
| 60 | 60 | * @param array $parameters Extra parameters |
| 61 | 61 | */ |
@@ -112,6 +112,11 @@ discard block |
||
| 112 | 112 | return $this->getTenantPrefix(self::DEFAULT_TENANT_DOMAIN).'/'.ltrim($id, '/'); |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | + /** |
|
| 116 | + * @param string $id |
|
| 117 | + * |
|
| 118 | + * @return null|\SWP\Bundle\ContentBundle\Model\RouteInterface |
|
| 119 | + */ |
|
| 115 | 120 | public function getRouteByName($id) |
| 116 | 121 | { |
| 117 | 122 | return $this->container->get('swp.provider.route')->getRouteByName($id); |
@@ -120,7 +125,7 @@ discard block |
||
| 120 | 125 | /** |
| 121 | 126 | * Gets current tenant's prefix. |
| 122 | 127 | * |
| 123 | - * @param string $subdomain |
|
| 128 | + * @param string $domain |
|
| 124 | 129 | * |
| 125 | 130 | * @return string |
| 126 | 131 | */ |
@@ -17,7 +17,6 @@ |
||
| 17 | 17 | namespace SWP\Bundle\ContentBundle\Doctrine\ORM; |
| 18 | 18 | |
| 19 | 19 | use Doctrine\ORM\QueryBuilder; |
| 20 | -use Elastica\Query; |
|
| 21 | 20 | use SWP\Bundle\ContentBundle\Model\ArticleSourceReference; |
| 22 | 21 | use SWP\Component\Common\Criteria\Criteria; |
| 23 | 22 | use SWP\Bundle\ContentBundle\Doctrine\ArticleRepositoryInterface; |
@@ -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 | */ |