From c6cc2a1a42a5feae07e9a6affd513e1f766442b2 Mon Sep 17 00:00:00 2001 From: "J. King" Date: Fri, 29 Apr 2022 17:23:41 -0400 Subject: [PATCH] Restore coverage for Query class --- lib/Misc/QueryFilter.php | 6 +++--- tests/cases/Misc/TestQuery.php | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/Misc/QueryFilter.php b/lib/Misc/QueryFilter.php index 12c3bd30..f4a663d6 100644 --- a/lib/Misc/QueryFilter.php +++ b/lib/Misc/QueryFilter.php @@ -16,7 +16,7 @@ class QueryFilter { public $filterRestrictive = true; - public function setWhere(string $where, $types = null, $values = null): self { + public function setWhere(string $where, $types = null, $values = null): static { $this->qWhere[] = $where; if (!is_null($types)) { $this->tWhere[] = $types ?? []; @@ -25,7 +25,7 @@ class QueryFilter { return $this; } - public function setWhereNot(string $where, $types = null, $values = null): self { + public function setWhereNot(string $where, $types = null, $values = null): static { $this->qWhereNot[] = $where; if (!is_null($types)) { $this->tWhereNot[] = $types; @@ -34,7 +34,7 @@ class QueryFilter { return $this; } - public function setFilter(self $filter): self { + public function setFilter(self $filter): static { $this->qWhere[] = "(".$filter->buildWhereBody().")"; $this->tWhere[] = $filter->getWhereTypes(); $this->vWhere[] = $filter->getWhereValues(); diff --git a/tests/cases/Misc/TestQuery.php b/tests/cases/Misc/TestQuery.php index 053d1091..f78ac2d2 100644 --- a/tests/cases/Misc/TestQuery.php +++ b/tests/cases/Misc/TestQuery.php @@ -8,7 +8,10 @@ namespace JKingWeb\Arsse\TestCase\Misc; use JKingWeb\Arsse\Misc\Query; -/** @covers \JKingWeb\Arsse\Misc\Query */ +/** + * @covers \JKingWeb\Arsse\Misc\Query + * @covers \JKingWeb\Arsse\Misc\QueryFilter + */ class TestQuery extends \JKingWeb\Arsse\Test\AbstractTest { public function testBasicQuery(): void { $q = new Query("select * from table where a = ?", "int", 3);