@@ -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'; |
|
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | public function buildForm(FormBuilderInterface $builder, array $options): void |
| 25 | 25 | { |
| 26 | 26 | $builder |
| 27 | - ->add('photo', FileType::class, ['label' => 'label.photo']) |
|
| 27 | + ->add('photo', FileType::class, [ 'label' => 'label.photo' ]) |
|
| 28 | 28 | ->add('priority', null, [ |
| 29 | 29 | 'attr' => [ |
| 30 | 30 | 'class' => 'form-control', |
@@ -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 |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $this->addFlash('success', 'message.uploaded'); |
| 49 | 49 | |
| 50 | - return $this->redirectToRoute('admin_photo_edit', ['id' => $property->getId()]); |
|
| 50 | + return $this->redirectToRoute('admin_photo_edit', [ 'id' => $property->getId() ]); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | return $this->render('admin/photo/edit.html.twig', [ |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | if (!$this->isCsrfTokenValid('delete', $request->request->get('token'))) { |
| 69 | 69 | return $this->redirectToRoute( |
| 70 | 70 | 'admin_photo_edit', |
| 71 | - ['id' => $request->attributes->get('property_id')] |
|
| 71 | + [ 'id' => $request->attributes->get('property_id') ] |
|
| 72 | 72 | ); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | return $this->redirectToRoute( |
| 86 | 86 | 'admin_photo_edit', |
| 87 | - ['id' => $request->attributes->get('property_id')] |
|
| 87 | + [ 'id' => $request->attributes->get('property_id') ] |
|
| 88 | 88 | ); |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -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', [ |
@@ -91,9 +91,9 @@ |
||
| 91 | 91 | $items = $request->request->get('items'); |
| 92 | 92 | $repository = $this->getDoctrine()->getRepository(Menu::class); |
| 93 | 93 | $repository->reorderItems($items); |
| 94 | - $response = json_encode(['status' => 'ok']); |
|
| 94 | + $response = json_encode([ 'status' => 'ok' ]); |
|
| 95 | 95 | |
| 96 | - return new JsonResponse($response, 200, [], true); |
|
| 96 | + return new JsonResponse($response, 200, [ ], true); |
|
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | /** |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | { |
| 23 | 23 | $repository = $this->getDoctrine()->getRepository(Setting::class); |
| 24 | 24 | |
| 25 | - $settings = $repository->findAll()[0]; |
|
| 25 | + $settings = $repository->findAll()[ 0 ]; |
|
| 26 | 26 | |
| 27 | 27 | $form = $this->createForm(SettingType::class, $settings); |
| 28 | 28 | $form->handleRequest($request); |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | $this->addFlash('success', 'message.created'); |
| 58 | 58 | |
| 59 | - return $this->redirectToRoute('admin_photo_edit', ['id' => $property->getId()]); |
|
| 59 | + return $this->redirectToRoute('admin_photo_edit', [ 'id' => $property->getId() ]); |
|
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | return $this->render('admin/property/new.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); |