@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | // https://gordalina.github.io/cachetool/ |
| 25 | 25 | // https://github.com/deployphp/deployer/blob/master/contrib/cachetool.php#L55 |
| 26 | 26 | // https://github.com/gordalina/cachetool/releases/download/7.0.0/cachetool.phar |
| 27 | -set('bin/cachetool', function () { |
|
| 27 | +set('bin/cachetool', function() { |
|
| 28 | 28 | if (!test('[ -f {{release_or_current_path}}/cachetool.phar ]')) { |
| 29 | 29 | run("cd {{release_or_current_path}} && curl -sLO https://github.com/gordalina/cachetool/releases/download/7.0.0/cachetool.phar"); |
| 30 | 30 | } |
@@ -73,11 +73,11 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // Tasks |
| 75 | 75 | |
| 76 | -task('build', function () { |
|
| 76 | +task('build', function() { |
|
| 77 | 77 | run('cd {{release_path}} && build'); |
| 78 | 78 | }); |
| 79 | 79 | |
| 80 | -task('deploy:stop-workers', function () { |
|
| 80 | +task('deploy:stop-workers', function() { |
|
| 81 | 81 | // Hack alert: https://stackoverflow.com/a/63652279/300836 |
| 82 | 82 | // We've just move the previous release out of the way, but it's |
| 83 | 83 | // the previous release's cache that has the details of the |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | })->desc('Stop any existing messenger consumers; Supervisor will restart them.'); |
| 89 | 89 | |
| 90 | 90 | // Testing |
| 91 | -task('pwd', function () { |
|
| 91 | +task('pwd', function() { |
|
| 92 | 92 | $result = run('pwd'); |
| 93 | 93 | writeln("Current dir: $result"); |
| 94 | 94 | }); |
| 95 | 95 | |
| 96 | -task('test', function () { |
|
| 96 | +task('test', function() { |
|
| 97 | 97 | writeln('Hello world'); |
| 98 | 98 | }); |
| 99 | 99 | |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | */ |
| 69 | 69 | public function getImageLocationStats(): array |
| 70 | 70 | { |
| 71 | - return $this->cache->get('image_location_stats', function (ItemInterface $item) { |
|
| 71 | + return $this->cache->get('image_location_stats', function(ItemInterface $item) { |
|
| 72 | 72 | $item->tag('stats'); |
| 73 | 73 | $stats = $this->imageRepository |
| 74 | 74 | ->createQueryBuilder('i') |
@@ -85,8 +85,7 @@ |
||
| 85 | 85 | $wander->setMaxAltitude($stats->maxAltitude); |
| 86 | 86 | $wander->setMinAltitude($stats->minAltitude); |
| 87 | 87 | $wander->setCumulativeElevationGain($stats->cumulativeElevationGain); |
| 88 | - } |
|
| 89 | - catch (Exception $e) { |
|
| 88 | + } catch (Exception $e) { |
|
| 90 | 89 | //$this->logger->debug("Couldn't set extended GPX property on wander: " . $e->getMessage()); |
| 91 | 90 | throw new Exception("Couldn't set standard GPX stats properties on wander.", 0, $e); |
| 92 | 91 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | // It's nicer for our JavaScript to be handed the Wander URI on a plate, so we add it |
| 47 | 47 | // to the returned JSON. |
| 48 | - $contentUrlCallback = function ( |
|
| 48 | + $contentUrlCallback = function( |
|
| 49 | 49 | /** @scrutinizer ignore-unused */ $innerObject, |
| 50 | 50 | $outerObject, |
| 51 | 51 | /** @scrutinizer ignore-unused */ string $attributeName, |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | ): Response { |
| 94 | 94 | // It's nicer for our JavaScript to be handed the Wander URI on a plate, so we add it |
| 95 | 95 | // to the returned JSON. |
| 96 | - $contentUrlCallback = function ( |
|
| 96 | + $contentUrlCallback = function( |
|
| 97 | 97 | /** @scrutinizer ignore-unused */ $innerObject, |
| 98 | 98 | $outerObject, |
| 99 | 99 | /** @scrutinizer ignore-unused */ string $attributeName, |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | |
| 80 | 80 | $token = $request->request->get('token'); |
| 81 | 81 | if (!$this->isCsrfTokenValid('image_upload', $token)) { |
| 82 | - return $this->json([ 'error' => 'Invalid CSRF token'], 401); |
|
| 82 | + return $this->json(['error' => 'Invalid CSRF token'], 401); |
|
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | $file = $request->files->get('file'); |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | */ |
| 151 | 151 | public function delete(Request $request, Image $image): Response |
| 152 | 152 | { |
| 153 | - if ($this->isCsrfTokenValid('delete'.$image->getId(), $request->request->get('_token'))) { |
|
| 153 | + if ($this->isCsrfTokenValid('delete' . $image->getId(), $request->request->get('_token'))) { |
|
| 154 | 154 | $entityManager = $this->getDoctrine()->getManager(); |
| 155 | 155 | $entityManager->remove($image); |
| 156 | 156 | $entityManager->flush(); |
@@ -164,8 +164,8 @@ discard block |
||
| 164 | 164 | */ |
| 165 | 165 | public function setLocation(Request $request, Image $image, LocationService $locationService, EntityManagerInterface $entityManager): Response |
| 166 | 166 | { |
| 167 | - if ($this->isCsrfTokenValid('set_location'.$image->getId(), $request->request->get('_token'))) { |
|
| 168 | - $neighbourhood = $locationService->getLocationName($image->getLatitude(), $image->getLongitude()); |
|
| 167 | + if ($this->isCsrfTokenValid('set_location' . $image->getId(), $request->request->get('_token'))) { |
|
| 168 | + $neighbourhood = $locationService->getLocationName($image->getLatitude(), $image->getLongitude()); |
|
| 169 | 169 | if ($neighbourhood !== null) { |
| 170 | 170 | $image->setLocation($neighbourhood); |
| 171 | 171 | $entityManager->persist($image); |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | */ |
| 182 | 182 | public function setAutoTags(Request $request, Image $image, MessageBusInterface $messageBus): Response |
| 183 | 183 | { |
| 184 | - if ($this->isCsrfTokenValid('set_auto_tags'.$image->getId(), $request->request->get('_token'))) { |
|
| 184 | + if ($this->isCsrfTokenValid('set_auto_tags' . $image->getId(), $request->request->get('_token'))) { |
|
| 185 | 185 | $imageId = $image->getId(); |
| 186 | 186 | if ($imageId === null) { |
| 187 | 187 | throw new InvalidParameterException('No image id in setAutoTags'); |