@@ -20,7 +20,7 @@ |
||
20 | 20 | use SWP\Bundle\CoreBundle\Model\OrganizationInterface; |
21 | 21 | use SWP\Component\MultiTenancy\Context\TenantContextInterface; |
22 | 22 | use Symfony\Component\HttpFoundation\Response; |
23 | -use Symfony\Component\HttpKernel\Event\RequestEvent ; |
|
23 | +use Symfony\Component\HttpKernel\Event\RequestEvent; |
|
24 | 24 | |
25 | 25 | class SecuredContentPushListener |
26 | 26 | { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | namespace SWP\Bundle\CoreBundle\EventListener; |
16 | 16 | |
17 | 17 | use SWP\Bundle\CoreBundle\Detection\DeviceDetectionInterface; |
18 | -use Symfony\Component\HttpKernel\Event\RequestEvent ; |
|
18 | +use Symfony\Component\HttpKernel\Event\RequestEvent; |
|
19 | 19 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
20 | 20 | |
21 | 21 | class CurrentDeviceListener |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $currentlyLoggedInUser = $this->getUser(); |
100 | 100 | |
101 | 101 | $now = PublisherDateTime::getCurrentDateTime(); |
102 | - $fileName = 'analytics-' . $now->format('Y-m-d-H:i:s') . '.csv'; |
|
102 | + $fileName = 'analytics-'.$now->format('Y-m-d-H:i:s').'.csv'; |
|
103 | 103 | |
104 | 104 | $form = $this->formFactory->createNamed('', ExportAnalyticsType::class, null, ['method' => $request->getMethod()]); |
105 | 105 | $form->handleRequest($request); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | public function downloadFile(string $fileName): Response { |
163 | 163 | $cacheKey = md5(serialize(['analytics_report', $fileName])); |
164 | 164 | |
165 | - $analyticsReport = $this->cacheProvider->get($cacheKey, function () use ($fileName) { |
|
165 | + $analyticsReport = $this->cacheProvider->get($cacheKey, function() use ($fileName) { |
|
166 | 166 | /* @var AnalyticsReportInterface|null $analyticsReport */ |
167 | 167 | return $this->analyticsReportRepository->findOneBy(['assetId' => $fileName]); |
168 | 168 | }); |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | $response->setMaxAge(63072000); |
185 | 185 | $response->setSharedMaxAge(63072000); |
186 | 186 | $response->setLastModified($analyticsReport->getUpdatedAt() ?: $analyticsReport->getCreatedAt()); |
187 | - $response->setContent($this->filesystem->read($this->csvReportFileLocationResolver->getMediaBasePath() . '/' . $analyticsReport->getAssetId())); |
|
187 | + $response->setContent($this->filesystem->read($this->csvReportFileLocationResolver->getMediaBasePath().'/'.$analyticsReport->getAssetId())); |
|
188 | 188 | |
189 | 189 | return $response; |
190 | 190 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * @Route("/api/{version}/packages/{id}/related/", methods={"GET"}, options={"expose"=true}, defaults={"version"="v2"}, name="swp_api_core_packages_related_articles", requirements={"id"="\d+"}) |
81 | 81 | */ |
82 | 82 | public function getRelatedAction(string $id) { |
83 | - $package = $this->findOr404((int)$id); |
|
83 | + $package = $this->findOr404((int) $id); |
|
84 | 84 | |
85 | 85 | $relatedArticlesList = $this->getRelated($package); |
86 | 86 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | private function getRelated(PackageInterface $package): RelatedArticleList { |
91 | - $relatedItemsGroups = $package->getItems()->filter(static function ($group) { |
|
91 | + $relatedItemsGroups = $package->getItems()->filter(static function($group) { |
|
92 | 92 | return ItemInterface::TYPE_TEXT === $group->getType(); |
93 | 93 | }); |
94 | 94 |
@@ -56,7 +56,7 @@ |
||
56 | 56 | * @Route("/api/{version}/webhooks/", options={"expose"=true}, defaults={"version"="v2"}, methods={"GET"}, name="swp_api_core_list_webhook") |
57 | 57 | */ |
58 | 58 | public function listAction(Request $request): ResourcesListResponseInterface { |
59 | - return $this->listWebhooks($this->eventDispatcher,$this->webhookRepository, $request); |
|
59 | + return $this->listWebhooks($this->eventDispatcher, $this->webhookRepository, $request); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -60,9 +60,9 @@ discard block |
||
60 | 60 | $this->tenantAwareThemeContext->getTheme() |
61 | 61 | ); |
62 | 62 | |
63 | - $fileName = (null === $fileExtension) ? basename($fileName) : $fileName . '.' . $fileExtension; |
|
63 | + $fileName = (null === $fileExtension) ? basename($fileName) : $fileName.'.'.$fileExtension; |
|
64 | 64 | foreach ($themes as $theme) { |
65 | - $filePath = $theme->getPath() . '/' . self::ASSETS_DIRECTORY . '/' . $fileName; |
|
65 | + $filePath = $theme->getPath().'/'.self::ASSETS_DIRECTORY.'/'.$fileName; |
|
66 | 66 | if (null !== $response = $this->handleFileLoading($filePath)) { |
67 | 67 | return $response; |
68 | 68 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | throw new NotFoundHttpException('File was not found.'); |
86 | 86 | } |
87 | 87 | |
88 | - $filePath = $theme->getPath() . '/screenshots/' . $fileName; |
|
88 | + $filePath = $theme->getPath().'/screenshots/'.$fileName; |
|
89 | 89 | if (null !== $response = $this->handleFileLoading($filePath)) { |
90 | 90 | return $response; |
91 | 91 | } |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | private function filterThemes($loadedThemes, string $themeName) { |
151 | 151 | $themes = array_filter( |
152 | 152 | $loadedThemes, |
153 | - function ($element) use (&$themeName) { |
|
153 | + function($element) use (&$themeName) { |
|
154 | 154 | return $element->getName() === $themeName; |
155 | 155 | } |
156 | 156 | ); |
@@ -169,10 +169,10 @@ |
||
169 | 169 | $settingsManager = $this->settingsManager; |
170 | 170 | |
171 | 171 | if (array_key_exists('fbiaEnabled', $formData)) { |
172 | - $settingsManager->set('fbia_enabled', (bool)$formData['fbiaEnabled'], ScopeContextInterface::SCOPE_TENANT, $tenant); |
|
172 | + $settingsManager->set('fbia_enabled', (bool) $formData['fbiaEnabled'], ScopeContextInterface::SCOPE_TENANT, $tenant); |
|
173 | 173 | } |
174 | 174 | if (array_key_exists('paywallEnabled', $formData)) { |
175 | - $settingsManager->set('paywall_enabled', (bool)$formData['paywallEnabled'], ScopeContextInterface::SCOPE_TENANT, $tenant); |
|
175 | + $settingsManager->set('paywall_enabled', (bool) $formData['paywallEnabled'], ScopeContextInterface::SCOPE_TENANT, $tenant); |
|
176 | 176 | } |
177 | 177 | if (array_key_exists('defaultLanguage', $formData)) { |
178 | 178 | $settingsManager->set('default_language', $formData['defaultLanguage'], ScopeContextInterface::SCOPE_TENANT, $tenant); |
@@ -82,7 +82,7 @@ |
||
82 | 82 | throw new NotFoundHttpException('Article was not found'); |
83 | 83 | } |
84 | 84 | |
85 | - $article->setCommentsCount((int)$data['commentsCount']); |
|
85 | + $article->setCommentsCount((int) $data['commentsCount']); |
|
86 | 86 | $article->cancelTimestampable(); |
87 | 87 | $repository->flush(); |
88 | 88 |
@@ -123,7 +123,7 @@ |
||
123 | 123 | $route = $this->findRouteOr404($routeId); |
124 | 124 | |
125 | 125 | /** @var string $content */ |
126 | - $content = (string)$request->getContent(); |
|
126 | + $content = (string) $request->getContent(); |
|
127 | 127 | $dispatcher = $this->eventDispatcher; |
128 | 128 | $package = $this->dataTransformer->transform($content); |
129 | 129 | $dispatcher->dispatch(new GenericEvent($package), Events::SWP_VALIDATION); |