Skip to content

Commit 8a45ca0

Browse files
committed
fix return types in wheregroup for php8.1 compatibility, increase minimum php version to 8.0
1 parent 81d3fd7 commit 8a45ca0

File tree

3 files changed

+79
-56
lines changed

3 files changed

+79
-56
lines changed

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"minimum-stability": "stable",
1919
"require": {
20-
"php": ">=7.4",
20+
"php": ">=8.0",
2121
"ext-json": "*"
2222
},
2323
"require-dev": {

composer.lock

+73-46
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Query/WhereGroup.php

+5-9
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,10 @@ public function __construct(array $conditions = [], int $conjunction = self:: AN
4949
/**
5050
* Add an element to the group
5151
*
52-
* @param WhereGroup|WhereCondition $conditionOrGroup
52+
* @param WhereCondition|WhereGroup $conditionOrGroup
5353
*/
54-
public function add($conditionOrGroup)
54+
public function add(WhereCondition|WhereGroup $conditionOrGroup)
5555
{
56-
if (!$conditionOrGroup instanceof WhereCondition && !$conditionOrGroup instanceof WhereGroup) {
57-
throw new \InvalidArgumentException('Argument $conditionOrGroup has to be instance of WhereCondition or WhereGroup.');
58-
}
59-
6056
$this->group[] = $conditionOrGroup;
6157
}
6258

@@ -75,7 +71,7 @@ public function getAll(): array
7571
*
7672
* @return WhereGroup|WhereCondition
7773
*/
78-
public function current()
74+
public function current(): WhereGroup|WhereCondition
7975
{
8076
return $this->group[$this->iterator];
8177
}
@@ -85,7 +81,7 @@ public function current()
8581
*
8682
* @return void
8783
*/
88-
public function next()
84+
public function next(): void
8985
{
9086
$this->iterator++;
9187
}
@@ -115,7 +111,7 @@ public function valid(): bool
115111
*
116112
* @return void
117113
*/
118-
public function rewind()
114+
public function rewind(): void
119115
{
120116
$this->iterator = 0;
121117
}

0 commit comments

Comments
 (0)