@@ -65,13 +65,13 @@ |
||
65 | 65 | public function getUser($credentials, UserProviderInterface $userProvider) |
66 | 66 | { |
67 | 67 | $token = new CsrfToken('authenticate', $credentials['csrf_token']); |
68 | - if (! $this->csrfTokenManager->isTokenValid($token)) { |
|
68 | + if (!$this->csrfTokenManager->isTokenValid($token)) { |
|
69 | 69 | throw new InvalidCsrfTokenException(); |
70 | 70 | } |
71 | 71 | |
72 | 72 | $user = $this->entityManager->getRepository(User::class)->findOneBy(['email' => $credentials['email']]); |
73 | 73 | |
74 | - if (! $user) { |
|
74 | + if (!$user) { |
|
75 | 75 | // fail authentication with a custom error |
76 | 76 | throw new CustomUserMessageAuthenticationException('security.login.email_not_found'); |
77 | 77 | } |
@@ -59,7 +59,7 @@ |
||
59 | 59 | { |
60 | 60 | $result = []; |
61 | 61 | foreach ($apps as $app) { |
62 | - if (! $app['template']) { |
|
62 | + if (!$app['template']) { |
|
63 | 63 | $app['template'] = $pwcTemplate; |
64 | 64 | } |
65 | 65 | $result[$app['hosts'][0]] = $app; |
@@ -39,7 +39,7 @@ |
||
39 | 39 | public function preRemove(Page $page) |
40 | 40 | { |
41 | 41 | // method_exists($page, 'getChildrenPages') && |
42 | - if (! $page->getChildrenPages()->isEmpty()) { |
|
42 | + if (!$page->getChildrenPages()->isEmpty()) { |
|
43 | 43 | foreach ($page->getChildrenPages() as $cPage) { |
44 | 44 | $cPage->setParentPage(null); |
45 | 45 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | { |
146 | 146 | preg_match_all('/(?:!\[(.*?)\]\((.*?)\))/', $body, $matches); |
147 | 147 | |
148 | - if (! isset($matches[1])) { |
|
148 | + if (!isset($matches[1])) { |
|
149 | 149 | return; |
150 | 150 | } |
151 | 151 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | |
168 | 168 | protected function render($string) |
169 | 169 | { |
170 | - if (! $string) { |
|
170 | + if (!$string) { |
|
171 | 171 | return ''; |
172 | 172 | } |
173 | 173 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | $defaultConverterOptions = []; |
66 | 66 | |
67 | 67 | foreach ($this->options2->getOptionsMap() as $id => $option) { |
68 | - if ($option->isValueExplicitlySet() && ! ($option instanceof GhostOption)) { |
|
68 | + if ($option->isValueExplicitlySet() && !($option instanceof GhostOption)) { |
|
69 | 69 | //$this->logLn('hi' . $id); |
70 | 70 | $defaultConverterOptions[$id] = $option->getValue(); |
71 | 71 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function get($default = false) |
37 | 37 | { |
38 | - if (! file_exists($this->filePath)) { |
|
38 | + if (!file_exists($this->filePath)) { |
|
39 | 39 | return false === $default ? false : new DateTime($default); |
40 | 40 | } |
41 | 41 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | |
45 | 45 | public function setWasRun($datetime = 'now', $setIfNotExist = true): void |
46 | 46 | { |
47 | - if (! file_exists($this->filePath)) { |
|
47 | + if (!file_exists($this->filePath)) { |
|
48 | 48 | if (false === $setIfNotExist) { |
49 | 49 | return; |
50 | 50 | } |
@@ -15,7 +15,7 @@ |
||
15 | 15 | $projectDir = $this->get('kernel')->getProjectDir(); |
16 | 16 | $pathToFile = $projectDir.'/media/'.substr(str_replace('..', '', $path), \strlen('media/')); |
17 | 17 | |
18 | - if (! file_exists($pathToFile)) { |
|
18 | + if (!file_exists($pathToFile)) { |
|
19 | 19 | throw $this->createNotFoundException('The media does not exist...'); |
20 | 20 | } |
21 | 21 |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $this->app->switchCurrentApp($host); |
121 | 121 | $pages = $this->getPages(null, $request); |
122 | 122 | |
123 | - if (! $pages) { |
|
123 | + if (!$pages) { |
|
124 | 124 | throw $this->createNotFoundException(); |
125 | 125 | } |
126 | 126 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | } |
172 | 172 | } |
173 | 173 | |
174 | - if (! $page->getLocale()) { // avoid bc break |
|
174 | + if (!$page->getLocale()) { // avoid bc break |
|
175 | 175 | $page->setLocale($this->params->get('pwc.locale')); |
176 | 176 | } |
177 | 177 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | $this->get('translator')->setLocale($page->getLocale()); |
180 | 180 | |
181 | 181 | // Check if page is public |
182 | - if ($page->getCreatedAt() > new \DateTimeImmutable() && ! $this->isGranted('ROLE_EDITOR')) { |
|
182 | + if ($page->getCreatedAt() > new \DateTimeImmutable() && !$this->isGranted('ROLE_EDITOR')) { |
|
183 | 183 | if ($throwException) { |
184 | 184 | throw $this->createNotFoundException(); |
185 | 185 | } else { |
@@ -200,8 +200,7 @@ discard block |
||
200 | 200 | $real = $request->getRequestUri(); |
201 | 201 | |
202 | 202 | $expected = 'homepage' == $page->getSlug() ? |
203 | - $this->get('piedweb.page_canonical')->generatePathForHomepage() : |
|
204 | - $this->get('piedweb.page_canonical')->generatePathForPage($page->getRealSlug()); |
|
203 | + $this->get('piedweb.page_canonical')->generatePathForHomepage() : $this->get('piedweb.page_canonical')->generatePathForPage($page->getRealSlug()); |
|
205 | 204 | |
206 | 205 | if ($real != $expected) { |
207 | 206 | return [$request->getBasePath().$expected, 301]; |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setSlugForce($slug) |
133 | 133 | { |
134 | - if (! $slug) { |
|
134 | + if (!$slug) { |
|
135 | 135 | return $this; |
136 | 136 | } |
137 | 137 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function setSlug($slug) |
166 | 166 | { |
167 | - if (! $slug) { |
|
167 | + if (!$slug) { |
|
168 | 168 | return $this; |
169 | 169 | } |
170 | 170 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | public function setMedia($media): self |
239 | 239 | { |
240 | - if (! $media) { |
|
240 | + if (!$media) { |
|
241 | 241 | return $this; |
242 | 242 | } |
243 | 243 |