@@ -5,9 +5,9 @@ |
||
| 5 | 5 | use Symfony\Component\ErrorHandler\Debug; |
| 6 | 6 | use Symfony\Component\HttpFoundation\Request; |
| 7 | 7 | |
| 8 | -require dirname(__DIR__).'/vendor/autoload.php'; |
|
| 8 | +require dirname(__DIR__) . '/vendor/autoload.php'; |
|
| 9 | 9 | |
| 10 | -(new Dotenv())->bootEnv(dirname(__DIR__).'/.env'); |
|
| 10 | +(new Dotenv())->bootEnv(dirname(__DIR__) . '/.env'); |
|
| 11 | 11 | |
| 12 | 12 | if ($_SERVER['APP_DEBUG']) { |
| 13 | 13 | umask(0000); |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | $this->imagineCacheManager = $imagineCacheManager; |
| 27 | 27 | |
| 28 | 28 | $this->filters = []; |
| 29 | - foreach($filterManager->getFilterConfiguration()->all() as $name => $filter) { |
|
| 29 | + foreach ($filterManager->getFilterConfiguration()->all() as $name => $filter) { |
|
| 30 | 30 | if (preg_match('/^srcset/', $name)) { |
| 31 | 31 | $width = $filter['filters']['relative_resize']['widen']; |
| 32 | 32 | $this->filters[] = [ |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $image_asset_path = $this->uploaderHelper->asset($image); |
| 43 | 43 | $srcset = []; |
| 44 | - foreach($this->filters as $filter) { |
|
| 44 | + foreach ($this->filters as $filter) { |
|
| 45 | 45 | $srcset[] = [ |
| 46 | 46 | 'width' => $filter['width'], |
| 47 | 47 | 'path' => $this->imagineCacheManager->getBrowserPath($image_asset_path, $filter['filter']) |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | // Add original image as srcset option, otherwise it may never be used. |
| 52 | 52 | $srcset[] = ['width' => $image->getDimensions()[0], 'path' => $image_asset_path]; |
| 53 | 53 | |
| 54 | - $srcsetString = implode(', ', array_map(function ($src) { |
|
| 54 | + $srcsetString = implode(', ', array_map(function($src) { |
|
| 55 | 55 | return sprintf( |
| 56 | 56 | '%s %uw', |
| 57 | 57 | $src['path'], |
@@ -16,8 +16,9 @@ |
||
| 16 | 16 | |
| 17 | 17 | public function durationToHMS(?DateInterval $interval): string |
| 18 | 18 | { |
| 19 | - if (!isset($interval)) |
|
| 20 | - return ""; |
|
| 19 | + if (!isset($interval)) { |
|
| 20 | + return ""; |
|
| 21 | + } |
|
| 21 | 22 | |
| 22 | 23 | return $interval->format('%H:%I:%S'); |
| 23 | 24 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $response = new Response(); |
| 87 | 87 | $format = $request->getRequestFormat(); |
| 88 | 88 | return $this->render( |
| 89 | - 'admin/wander/backlog.'.$format.'.twig', |
|
| 89 | + 'admin/wander/backlog.' . $format . '.twig', |
|
| 90 | 90 | [ |
| 91 | 91 | 'wanders' => $wanders |
| 92 | 92 | ], |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | */ |
| 180 | 180 | public function delete(Request $request, Wander $wander): Response |
| 181 | 181 | { |
| 182 | - if ($this->isCsrfTokenValid('delete'.$wander->getId(), $request->request->get('_token'))) { |
|
| 182 | + if ($this->isCsrfTokenValid('delete' . $wander->getId(), $request->request->get('_token'))) { |
|
| 183 | 183 | $entityManager = $this->getDoctrine()->getManager(); |
| 184 | 184 | $entityManager->remove($wander); |
| 185 | 185 | $entityManager->flush(); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public function deleteImages(Request $request, Wander $wander): Response |
| 195 | 195 | { |
| 196 | - if ($this->isCsrfTokenValid('delete_images'.$wander->getId(), $request->request->get('_token'))) { |
|
| 196 | + if ($this->isCsrfTokenValid('delete_images' . $wander->getId(), $request->request->get('_token'))) { |
|
| 197 | 197 | $entityManager = $this->getDoctrine()->getManager(); |
| 198 | 198 | $images = $wander->getImages(); |
| 199 | 199 | foreach ($images as $image) { |
@@ -118,8 +118,7 @@ |
||
| 118 | 118 | $this->getParameter('gpx_directory'), |
| 119 | 119 | $newFilename |
| 120 | 120 | ); |
| 121 | - } |
|
| 122 | - catch (FileException $e) { |
|
| 121 | + } catch (FileException $e) { |
|
| 123 | 122 | throw new HttpException(500, "Failed finishing GPX upload: " . $e->getMessage()); |
| 124 | 123 | } |
| 125 | 124 | $wander->setGpxFilename($newFilename); |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | $number = random_int(0, 10000); |
| 16 | 16 | |
| 17 | 17 | return new Response( |
| 18 | - '<html><body>Lucky number: '.$number.'</body></html>' |
|
| 18 | + '<html><body>Lucky number: ' . $number . '</body></html>' |
|
| 19 | 19 | ); |
| 20 | 20 | } |
| 21 | 21 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | new File([ |
| 39 | 39 | 'maxSize' => '1024k', |
| 40 | 40 | 'mimeTypes' => [ |
| 41 | - "application/gpx+xml","text/xml","application/xml","application/octet-stream" |
|
| 41 | + "application/gpx+xml", "text/xml", "application/xml", "application/octet-stream" |
|
| 42 | 42 | ], |
| 43 | 43 | 'mimeTypesMessage' =>'Please upload a valid GPX document' |
| 44 | 44 | ]) |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (file_exists(dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php')) { |
|
| 4 | - require dirname(__DIR__).'/var/cache/prod/App_KernelProdContainer.preload.php'; |
|
| 3 | +if (file_exists(dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php')) { |
|
| 4 | + require dirname(__DIR__) . '/var/cache/prod/App_KernelProdContainer.preload.php'; |
|
| 5 | 5 | } |
@@ -4,10 +4,10 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface ExifHelperInterface |
| 6 | 6 | { |
| 7 | - public function getTitle():?string; |
|
| 8 | - public function getDescription():?string; |
|
| 9 | - public function getGPS():?array; |
|
| 10 | - public function getKeywords():?array; |
|
| 11 | - public function getCreationDate():?\DateTime; |
|
| 12 | - public function getRating():?int; |
|
| 7 | + public function getTitle(): ?string; |
|
| 8 | + public function getDescription(): ?string; |
|
| 9 | + public function getGPS(): ?array; |
|
| 10 | + public function getKeywords(): ?array; |
|
| 11 | + public function getCreationDate(): ?\DateTime; |
|
| 12 | + public function getRating(): ?int; |
|
| 13 | 13 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | |
| 71 | 71 | $token = $request->request->get('token'); |
| 72 | 72 | if (!$this->isCsrfTokenValid('image_upload', $token)) { |
| 73 | - return $this->json([ 'error' => 'Invalid CSRF token'], 401); |
|
| 73 | + return $this->json(['error' => 'Invalid CSRF token'], 401); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | $file = $request->files->get('file'); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | // file we just uploaded*, thanks to the IGNORED_ATTRIBUTES. Because we set up the |
| 89 | 89 | // image URIs in a postPersist event listener, this also contains everything you'd |
| 90 | 90 | // need to build an image in HTML. |
| 91 | - return new JsonResponse($serializer->serialize($image, 'jsonld', [AbstractNormalizer::IGNORED_ATTRIBUTES => ['imageFile']]), 201,[], true); |
|
| 91 | + return new JsonResponse($serializer->serialize($image, 'jsonld', [AbstractNormalizer::IGNORED_ATTRIBUTES => ['imageFile']]), 201, [], true); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | // Normal GET request. |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | */ |
| 137 | 137 | public function delete(Request $request, Image $image): Response |
| 138 | 138 | { |
| 139 | - if ($this->isCsrfTokenValid('delete'.$image->getId(), $request->request->get('_token'))) { |
|
| 139 | + if ($this->isCsrfTokenValid('delete' . $image->getId(), $request->request->get('_token'))) { |
|
| 140 | 140 | $entityManager = $this->getDoctrine()->getManager(); |
| 141 | 141 | $entityManager->remove($image); |
| 142 | 142 | $entityManager->flush(); |