From d3e3680256f0888788d93ee076dd06d183365f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schadegg=20Br=C3=B8nniche?= Date: Thu, 29 Feb 2024 13:39:01 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Allow=20mixed=20value=20as=20ope?= =?UTF-8?q?ratororvalue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Classes/EconomicQueryBuilder.php | 4 ++-- src/Classes/EconomicQueryFilterBuilder.php | 4 ++-- src/Classes/EconomicRelatedResource.php | 2 +- src/Traits/Resources/GetCollectionable.php | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Classes/EconomicQueryBuilder.php b/src/Classes/EconomicQueryBuilder.php index a53932a..3edf64c 100644 --- a/src/Classes/EconomicQueryBuilder.php +++ b/src/Classes/EconomicQueryBuilder.php @@ -42,7 +42,7 @@ protected function getEndpoint(): string return $this->endpoint; } - public function where(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static + public function where(int|string|Closure $propertyName, mixed $operatorOrValue = null, mixed $value = null): static { if (! isset($this->filter)) { $this->filter = new EconomicQueryFilterBuilder(EconomicQueryFilterBuilder::FILTER_RELATION_AND); @@ -53,7 +53,7 @@ public function where(int|string|Closure $propertyName, ?string $operatorOrValue return $this; } - public function orWhere(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static + public function orWhere(int|string|Closure $propertyName, mixed $operatorOrValue = null, mixed $value = null): static { if (! isset($this->filter)) { $this->filter = new EconomicQueryFilterBuilder(EconomicQueryFilterBuilder::FILTER_RELATION_OR); diff --git a/src/Classes/EconomicQueryFilterBuilder.php b/src/Classes/EconomicQueryFilterBuilder.php index 5d6d556..2f3f5a1 100644 --- a/src/Classes/EconomicQueryFilterBuilder.php +++ b/src/Classes/EconomicQueryFilterBuilder.php @@ -110,7 +110,7 @@ protected function whereNested(Closure $closure) return $this; } - public function where(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static + public function where(int|string|Closure $propertyName, mixed $operatorOrValue = null, mixed $value = null): static { if ($propertyName instanceof Closure) { return $this->whereNested($propertyName); @@ -144,7 +144,7 @@ public function where(int|string|Closure $propertyName, ?string $operatorOrValue return $this; } - public function orWhere(int|string|Closure $propertyName, ?string $operatorOrValue = null, mixed $value = null): static + public function orWhere(int|string|Closure $propertyName, mixed $operatorOrValue = null, mixed $value = null): static { $instance = new static(static::FILTER_RELATION_OR); diff --git a/src/Classes/EconomicRelatedResource.php b/src/Classes/EconomicRelatedResource.php index a2688e4..43f227e 100644 --- a/src/Classes/EconomicRelatedResource.php +++ b/src/Classes/EconomicRelatedResource.php @@ -39,7 +39,7 @@ public function find(string|int $reference): ?Resource /** * @return EconomicQueryBuilder */ - public function where(int|string $propertyName, string $operatorOrValue, mixed $value = null): EconomicQueryBuilder + public function where(int|string $propertyName, mixed $operatorOrValue = null, mixed $value = null): EconomicQueryBuilder { return (new EconomicQueryBuilder($this->resourceClass))->setEndpoint($this->endpointCollection->getEndpoint($this->references))->where($propertyName, $operatorOrValue, $value); diff --git a/src/Traits/Resources/GetCollectionable.php b/src/Traits/Resources/GetCollectionable.php index a402a23..fa20276 100644 --- a/src/Traits/Resources/GetCollectionable.php +++ b/src/Traits/Resources/GetCollectionable.php @@ -15,7 +15,7 @@ trait GetCollectionable /** * @return EconomicQueryBuilder */ - public static function where(int|string $propertyName, string $operatorOrValue, mixed $value = null): EconomicQueryBuilder + public static function where(int|string $propertyName, mixed $operatorOrValue = null, mixed $value = null): EconomicQueryBuilder { return (new EconomicQueryBuilder(static::class))->where($propertyName, $operatorOrValue, $value); }