@@ -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'], |
@@ -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) { |
@@ -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 | } |
@@ -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 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $wander->setMinAltitude($stats->minAltitude); |
| 81 | 81 | $wander->setCumulativeElevationGain($stats->cumulativeElevationGain); |
| 82 | 82 | } |
| 83 | - catch(Exception $e) { |
|
| 83 | + catch (Exception $e) { |
|
| 84 | 84 | //$this->logger->debug("Couldn't set extended GPX property on wander: " . $e->getMessage()); |
| 85 | 85 | throw new Exception("Couldn't set standard GPX stats properties on wander.", 0, $e); |
| 86 | 86 | } |
@@ -111,10 +111,10 @@ discard block |
||
| 111 | 111 | public function compass(float $x, float $y): float |
| 112 | 112 | { |
| 113 | 113 | // https://www.php.net/manual/en/function.atan2.php#88119 |
| 114 | - if($x==0 AND $y==0){ return 0; } // ...or return 360 |
|
| 114 | + if ($x == 0 AND $y == 0) { return 0; } // ...or return 360 |
|
| 115 | 115 | return ($x < 0) |
| 116 | - ? rad2deg(atan2($x,$y)) + 360 |
|
| 117 | - : rad2deg(atan2($x,$y)); |
|
| 116 | + ? rad2deg(atan2($x, $y)) + 360 |
|
| 117 | + : rad2deg(atan2($x, $y)); |
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | public function gpxToGeoJson(string $gpx, float $epsilon, int $precision): string |
@@ -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 | |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | $tags = []; |
| 101 | - foreach($imagga_result->result->tags as $tag) { |
|
| 101 | + foreach ($imagga_result->result->tags as $tag) { |
|
| 102 | 102 | $tags[] = $tag->tag->en; |
| 103 | 103 | } |
| 104 | 104 | $image->setAutoTags($tags); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $image->setLocation($exifHelper->getLocation()); |
| 100 | 100 | } |
| 101 | 101 | } |
| 102 | - catch(Exception $e) { |
|
| 102 | + catch (Exception $e) { |
|
| 103 | 103 | // We've started to rely on the information gathered here, so I think |
| 104 | 104 | // this should be a proper error now. |
| 105 | 105 | throw new Exception('Error getting image Exif information: ' . $e->getMessage(), $e->getCode(), $e); |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | } |
| 147 | - catch(Exception $e) { |
|
| 147 | + catch (Exception $e) { |
|
| 148 | 148 | // We've started to rely on the information gathered here, so I think |
| 149 | 149 | // this should be a proper error now. |
| 150 | 150 | throw new Exception('Error getting image Exif information: ' . $e->getMessage(), $e->getCode(), $e); |
@@ -98,8 +98,7 @@ discard block |
||
| 98 | 98 | if ($image->getLocation() === null || $image->getLocation() === '') { |
| 99 | 99 | $image->setLocation($exifHelper->getLocation()); |
| 100 | 100 | } |
| 101 | - } |
|
| 102 | - catch(Exception $e) { |
|
| 101 | + } catch(Exception $e) { |
|
| 103 | 102 | // We've started to rely on the information gathered here, so I think |
| 104 | 103 | // this should be a proper error now. |
| 105 | 104 | throw new Exception('Error getting image Exif information: ' . $e->getMessage(), $e->getCode(), $e); |
@@ -143,8 +142,7 @@ discard block |
||
| 143 | 142 | } |
| 144 | 143 | } |
| 145 | 144 | } |
| 146 | - } |
|
| 147 | - catch(Exception $e) { |
|
| 145 | + } catch(Exception $e) { |
|
| 148 | 146 | // We've started to rely on the information gathered here, so I think |
| 149 | 147 | // this should be a proper error now. |
| 150 | 148 | throw new Exception('Error getting image Exif information: ' . $e->getMessage(), $e->getCode(), $e); |