@@ -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); |
@@ -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 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $wander->setMinAltitude($stats->minAltitude); |
| 58 | 58 | $wander->setCumulativeElevationGain($stats->cumulativeElevationGain); |
| 59 | 59 | } |
| 60 | - catch(Exception $e) { |
|
| 60 | + catch (Exception $e) { |
|
| 61 | 61 | //$this->logger->debug("Couldn't set extended GPX property on wander: " . $e->getMessage()); |
| 62 | 62 | throw new Exception("Couldn't set standard GPX stats properties on wander.", 0, $e); |
| 63 | 63 | } |
@@ -89,10 +89,10 @@ discard block |
||
| 89 | 89 | public function compass(float $x, float $y): float |
| 90 | 90 | { |
| 91 | 91 | // https://www.php.net/manual/en/function.atan2.php#88119 |
| 92 | - if($x==0 AND $y==0){ return 0; } // ...or return 360 |
|
| 92 | + if ($x == 0 AND $y == 0) { return 0; } // ...or return 360 |
|
| 93 | 93 | return ($x < 0) |
| 94 | - ? rad2deg(atan2($x,$y)) + 360 |
|
| 95 | - : rad2deg(atan2($x,$y)); |
|
| 94 | + ? rad2deg(atan2($x, $y)) + 360 |
|
| 95 | + : rad2deg(atan2($x, $y)); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | public function updateWanderStatsFromGpx(Wander $wander): void |
@@ -56,8 +56,7 @@ |
||
| 56 | 56 | $wander->setMaxAltitude($stats->maxAltitude); |
| 57 | 57 | $wander->setMinAltitude($stats->minAltitude); |
| 58 | 58 | $wander->setCumulativeElevationGain($stats->cumulativeElevationGain); |
| 59 | - } |
|
| 60 | - catch(Exception $e) { |
|
| 59 | + } catch(Exception $e) { |
|
| 61 | 60 | //$this->logger->debug("Couldn't set extended GPX property on wander: " . $e->getMessage()); |
| 62 | 61 | throw new Exception("Couldn't set standard GPX stats properties on wander.", 0, $e); |
| 63 | 62 | } |
@@ -375,7 +375,7 @@ |
||
| 375 | 375 | 13 => 'NW', |
| 376 | 376 | 14 => 'NW', |
| 377 | 377 | 15 => 'N' |
| 378 | - ]; |
|
| 378 | + ]; |
|
| 379 | 379 | |
| 380 | 380 | public function getSector(): ?string |
| 381 | 381 | { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | // TODO: Maybe try combining results from $imageFinder and $wanderFinder? |
| 41 | 41 | |
| 42 | - $form = $this->createFormBuilder(null, ['method' => 'GET' ]) |
|
| 42 | + $form = $this->createFormBuilder(null, ['method' => 'GET']) |
|
| 43 | 43 | ->add('query', SearchType::class, ['label' => false]) |
| 44 | 44 | ->getForm(); |
| 45 | 45 | |