Fix PHPCS errors
This commit is contained in:
parent
ae50869065
commit
6350054e45
|
@ -1,5 +1,4 @@
|
||||||
name: Custom Test
|
name: Custom Test
|
||||||
type: module
|
type: module
|
||||||
core: 8.x
|
core_version_requirement: ^8 || ^9
|
||||||
core_version_requirements: ^8 || ^9
|
|
||||||
hidden: true
|
hidden: true
|
||||||
|
|
|
@ -14,27 +14,27 @@ use Drupal\views\Annotation\ViewsSort;
|
||||||
*/
|
*/
|
||||||
final class Event extends Date {
|
final class Event extends Date {
|
||||||
|
|
||||||
public function query() {
|
public function query() {
|
||||||
$this->ensureMyTable();
|
$this->ensureMyTable();
|
||||||
|
|
||||||
$currentTime = time();
|
$currentTime = time();
|
||||||
$dateAlias = "$this->tableAlias.$this->realField";
|
$dateAlias = "$this->tableAlias.$this->realField";
|
||||||
|
|
||||||
// Is this event in the past?
|
// Is this event in the past?
|
||||||
$this->query->addOrderBy(
|
$this->query->addOrderBy(
|
||||||
NULL,
|
NULL,
|
||||||
sprintf("%d > %s", $currentTime, $dateAlias),
|
sprintf("%d > %s", $currentTime, $dateAlias),
|
||||||
$this->options['order'],
|
$this->options['order'],
|
||||||
"in_past"
|
"in_past"
|
||||||
);
|
);
|
||||||
|
|
||||||
// How far in the past/future is this event?
|
// How far in the past/future is this event?
|
||||||
$this->query->addOrderBy(
|
$this->query->addOrderBy(
|
||||||
NULL,
|
NULL,
|
||||||
sprintf('ABS(%s - %d)', $dateAlias, $currentTime),
|
sprintf('ABS(%s - %d)', $dateAlias, $currentTime),
|
||||||
$this->options['order'],
|
$this->options['order'],
|
||||||
"distance_from_now"
|
"distance_from_now"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue