@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | // Run "composer dump-env prod" to create it (requires symfony/flex >=1.2) |
9 | 9 | if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) { |
10 | 10 | foreach ($env as $k => $v) { |
11 | - $_ENV[$k] = $_ENV[$k] ?? (isset($_SERVER[$k]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[$k] : $v); |
|
11 | + $_ENV[ $k ] = $_ENV[ $k ] ?? (isset($_SERVER[ $k ]) && 0 !== strpos($k, 'HTTP_') ? $_SERVER[ $k ] : $v); |
|
12 | 12 | } |
13 | 13 | } elseif (!class_exists(Dotenv::class)) { |
14 | 14 | throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); |
@@ -18,6 +18,6 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | $_SERVER += $_ENV; |
21 | -$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; |
|
22 | -$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; |
|
23 | -$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; |
|
21 | +$_SERVER[ 'APP_ENV' ] = $_ENV[ 'APP_ENV' ] = ($_SERVER[ 'APP_ENV' ] ?? $_ENV[ 'APP_ENV' ] ?? null) ?: 'dev'; |
|
22 | +$_SERVER[ 'APP_DEBUG' ] = $_SERVER[ 'APP_DEBUG' ] ?? $_ENV[ 'APP_DEBUG' ] ?? 'prod' !== $_SERVER[ 'APP_ENV' ]; |
|
23 | +$_SERVER[ 'APP_DEBUG' ] = $_ENV[ 'APP_DEBUG' ] = (int) $_SERVER[ 'APP_DEBUG' ] || filter_var($_SERVER[ 'APP_DEBUG' ], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; |
@@ -17,7 +17,7 @@ |
||
17 | 17 | public function settings() |
18 | 18 | { |
19 | 19 | return $this->getDoctrine()->getRepository(Setting::class) |
20 | - ->findAll()[0]; |
|
20 | + ->findAll()[ 0 ]; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function menu(): array |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $pageService->create($page); |
44 | 44 | $this->addFlash('success', 'message.created'); |
45 | 45 | |
46 | - return $this->redirectToRoute('page', ['slug' => $page->getSlug()]); |
|
46 | + return $this->redirectToRoute('page', [ 'slug' => $page->getSlug() ]); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | return $this->render('admin/page/new.html.twig', [ |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | $this->getDoctrine()->getManager()->flush(); |
67 | 67 | $this->addFlash('success', 'message.updated'); |
68 | 68 | |
69 | - return $this->redirectToRoute('page', ['slug' => $page->getSlug()]); |
|
69 | + return $this->redirectToRoute('page', [ 'slug' => $page->getSlug() ]); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | return $this->render('admin/page/edit.html.twig', [ |
@@ -56,7 +56,7 @@ |
||
56 | 56 | $user->setPassword($this->passwordEncoder->encodePassword($user, $password)); |
57 | 57 | |
58 | 58 | // Set role |
59 | - $user->setRoles(['ROLE_ADMIN']); |
|
59 | + $user->setRoles([ 'ROLE_ADMIN' ]); |
|
60 | 60 | |
61 | 61 | $em = $this->getDoctrine()->getManager(); |
62 | 62 | $em->persist($user); |
@@ -32,14 +32,14 @@ |
||
32 | 32 | */ |
33 | 33 | private static function transliteration($str) |
34 | 34 | { |
35 | - $a = ['зг', 'Зг', 'А', 'а', 'Б', 'б', 'В', 'в', 'Г', 'г', 'Ґ', 'ґ', 'Д', 'д', 'Е', |
|
35 | + $a = [ 'зг', 'Зг', 'А', 'а', 'Б', 'б', 'В', 'в', 'Г', 'г', 'Ґ', 'ґ', 'Д', 'д', 'Е', |
|
36 | 36 | 'е', 'Ё', 'ё', 'Є', 'є', 'Ж', 'ж', 'З', 'з', 'И', 'и', 'І', 'і', 'Ї', 'ї', 'Й', 'й', 'К', 'к', |
37 | 37 | 'Л', 'л', 'М', 'м', 'Н', 'н', 'О', 'о', 'П', 'п', 'Р', 'р', 'С', 'с', 'Т', 'т', 'У', 'у', 'Ф', |
38 | 38 | 'ф', 'Х', 'х', 'Ц', 'ц', 'Ч', 'ч', 'Ш', 'ш', 'Щ', 'щ', 'Ы', 'ы', 'Э', 'э', 'Ю', 'ю', 'Я', 'я', |
39 | 39 | 'Ь', 'ь', 'Ъ', 'ъ', |
40 | 40 | ]; |
41 | 41 | |
42 | - $b = ['zgh', 'Zgh', 'A', 'a', 'B', 'b', 'V', 'v', 'G', 'g', 'G', 'g', 'D', 'd', 'E', |
|
42 | + $b = [ 'zgh', 'Zgh', 'A', 'a', 'B', 'b', 'V', 'v', 'G', 'g', 'G', 'g', 'D', 'd', 'E', |
|
43 | 43 | 'e', 'E', 'e', 'Ye', 'ie', 'Zh', 'zh', 'Z', 'z', 'I', 'i', 'I', 'i', 'Yi', 'i', 'Y', 'y', 'K', 'k', |
44 | 44 | 'L', 'l', 'M', 'm', 'N', 'n', 'O', 'o', 'P', 'p', 'R', 'r', 'S', 's', 'T', 't', 'U', 'u', 'F', 'f', 'Kh', 'kh', |
45 | 45 | 'Ts', 'ts', 'Ch', 'ch', 'Sh', 'sh', 'Shch', 'shch', 'Y', 'y', 'E', 'e', 'Yu', 'iu', 'Ya', 'ya', |
@@ -80,7 +80,7 @@ |
||
80 | 80 | public function addProperty(Property $property): self |
81 | 81 | { |
82 | 82 | if (!$this->properties->contains($property)) { |
83 | - $this->properties[] = $property; |
|
83 | + $this->properties[ ] = $property; |
|
84 | 84 | $property->setOperation($this); |
85 | 85 | } |
86 | 86 |
@@ -391,7 +391,7 @@ |
||
391 | 391 | public function addPhoto(Photo $photo): self |
392 | 392 | { |
393 | 393 | if (!$this->photos->contains($photo)) { |
394 | - $this->photos[] = $photo; |
|
394 | + $this->photos[ ] = $photo; |
|
395 | 395 | $photo->setProperty($this); |
396 | 396 | } |
397 | 397 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | public function addProperty(Property $property): self |
81 | 81 | { |
82 | 82 | if (!$this->properties->contains($property)) { |
83 | - $this->properties[] = $property; |
|
83 | + $this->properties[ ] = $property; |
|
84 | 84 | $property->setCategory($this); |
85 | 85 | } |
86 | 86 |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @ORM\Column(type="json") |
66 | 66 | */ |
67 | - private $roles = []; |
|
67 | + private $roles = [ ]; |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * @ORM\OneToMany(targetEntity="App\Entity\Property", mappedBy="author") |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | $roles = $this->roles; |
140 | 140 | // guarantees that a user always has at least one role for security |
141 | 141 | if (empty($roles)) { |
142 | - $roles[] = 'ROLE_USER'; |
|
142 | + $roles[ ] = 'ROLE_USER'; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | return array_unique($roles); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | public function serialize(): string |
181 | 181 | { |
182 | 182 | // add $this->salt too if you don't use Bcrypt or Argon2i |
183 | - return serialize([$this->id, $this->username, $this->password]); |
|
183 | + return serialize([ $this->id, $this->username, $this->password ]); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function unserialize($serialized): void |
190 | 190 | { |
191 | 191 | // add $this->salt too if you don't use Bcrypt or Argon2i |
192 | - [$this->id, $this->username, $this->password] = unserialize($serialized, ['allowed_classes' => false]); |
|
192 | + [ $this->id, $this->username, $this->password ] = unserialize($serialized, [ 'allowed_classes' => false ]); |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | /** |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | public function addProperty(Property $property): self |
204 | 204 | { |
205 | 205 | if (!$this->properties->contains($property)) { |
206 | - $this->properties[] = $property; |
|
206 | + $this->properties[ ] = $property; |
|
207 | 207 | $property->setAuthor($this); |
208 | 208 | } |
209 | 209 |