@@ -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 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function addRelatedPage(PageInterface $relatedPage): self |
| 30 | 30 | { |
| 31 | - if (! $this->relatedPages->contains($relatedPage)) { |
|
| 31 | + if (!$this->relatedPages->contains($relatedPage)) { |
|
| 32 | 32 | $this->relatedPages[] = $relatedPage; |
| 33 | 33 | } |
| 34 | 34 | |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | |
| 45 | 45 | public function addTranslation(self $translation, $recursive = true): self |
| 46 | 46 | { |
| 47 | - if (! $this->translations->contains($translation) && $this != $translation) { |
|
| 47 | + if (!$this->translations->contains($translation) && $this != $translation) { |
|
| 48 | 48 | $this->translations[] = $translation; |
| 49 | 49 | } |
| 50 | 50 | |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | |
| 82 | 82 | public function getImages(): Collection |
| 83 | 83 | { |
| 84 | - if (! $this->images) { |
|
| 84 | + if (!$this->images) { |
|
| 85 | 85 | $this->images = new ArrayCollection(); |
| 86 | 86 | foreach ($this->pageHasMedias as $p) { |
| 87 | 87 | if (null !== $p->getMedia()) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function validateOtherProperties(ExecutionContextInterface $context) |
| 78 | 78 | { |
| 79 | - if (! empty($this->otherProperties)) { |
|
| 79 | + if (!empty($this->otherProperties)) { |
|
| 80 | 80 | // ou utiliser yaml_parse |
| 81 | 81 | try { |
| 82 | 82 | Yaml::parse($this->otherProperties); |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | if (preg_match('/^get/', $method)) { |
| 122 | 122 | $property = lcfirst(preg_replace('/^get/', '', $method)); |
| 123 | - if (! property_exists(static::class, $property)) { |
|
| 123 | + if (!property_exists(static::class, $property)) { |
|
| 124 | 124 | return $this->getOtherProperty($property) ?? $this->getEmc($property); |
| 125 | 125 | // todo remove the else next release |
| 126 | 126 | } |
@@ -44,7 +44,7 @@ |
||
| 44 | 44 | 'label' => 'admin.user.email.label', |
| 45 | 45 | ]) |
| 46 | 46 | ->add('plainPassword', TextType::class, [ |
| 47 | - 'required' => (! $this->getSubject() || null === $this->getSubject()->getId()), |
|
| 47 | + 'required' => (!$this->getSubject() || null === $this->getSubject()->getId()), |
|
| 48 | 48 | 'label' => 'admin.user.password.label', |
| 49 | 49 | ]) |
| 50 | 50 | ->end(); |