From 6350054e45ddf2ead9441cbf82473350d0a1e513 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 30 Jun 2020 17:31:58 +0100 Subject: [PATCH] Fix PHPCS errors --- .../modules/custom_test/custom_test.info.yml | 3 +- .../opd_talks/src/Plugin/views/sort/Event.php | 32 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/web/modules/custom/custom/tests/modules/custom_test/custom_test.info.yml b/web/modules/custom/custom/tests/modules/custom_test/custom_test.info.yml index 7353524..071f4d8 100644 --- a/web/modules/custom/custom/tests/modules/custom_test/custom_test.info.yml +++ b/web/modules/custom/custom/tests/modules/custom_test/custom_test.info.yml @@ -1,5 +1,4 @@ name: Custom Test type: module -core: 8.x -core_version_requirements: ^8 || ^9 +core_version_requirement: ^8 || ^9 hidden: true diff --git a/web/modules/custom/opd_talks/src/Plugin/views/sort/Event.php b/web/modules/custom/opd_talks/src/Plugin/views/sort/Event.php index e65dc51..1d8f5a9 100644 --- a/web/modules/custom/opd_talks/src/Plugin/views/sort/Event.php +++ b/web/modules/custom/opd_talks/src/Plugin/views/sort/Event.php @@ -14,27 +14,27 @@ use Drupal\views\Annotation\ViewsSort; */ final class Event extends Date { - public function query() { - $this->ensureMyTable(); + public function query() { + $this->ensureMyTable(); - $currentTime = time(); - $dateAlias = "$this->tableAlias.$this->realField"; + $currentTime = time(); + $dateAlias = "$this->tableAlias.$this->realField"; - // Is this event in the past? - $this->query->addOrderBy( - NULL, - sprintf("%d > %s", $currentTime, $dateAlias), - $this->options['order'], - "in_past" - ); + // Is this event in the past? + $this->query->addOrderBy( + NULL, + sprintf("%d > %s", $currentTime, $dateAlias), + $this->options['order'], + "in_past" + ); - // How far in the past/future is this event? - $this->query->addOrderBy( - NULL, - sprintf('ABS(%s - %d)', $dateAlias, $currentTime), + // How far in the past/future is this event? + $this->query->addOrderBy( + NULL, + sprintf('ABS(%s - %d)', $dateAlias, $currentTime), $this->options['order'], "distance_from_now" ); - } + } }