Skip to content

Commit e5f993e

Browse files
committed
Fix Laravel 11 issues.
1 parent d8e7b4c commit e5f993e

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
},
3030
"minimum-stability": "dev",
3131
"require": {
32-
"illuminate/database": "^9.0||^8.0||^10.0"
32+
"illuminate/database": "^9.0||^8.0||^10.0||^11.0"
3333
},
3434
"suggest": {
3535
"jenssegers/mongodb": "Use QueryBuilderParser with MongoDB"
3636
},
3737
"require-dev": {
38-
"phpunit/phpunit": "^9.5||^8.5||^7.0",
38+
"phpunit/phpunit": "^9.5||^8.5||^7.0||^10.5",
3939
"mockery/mockery": "^1.3.1||^0.9.4"
4040
}
4141
}

src/QueryBuilderParser/JoinSupportingQueryBuilderParser.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
namespace timgws;
44

5-
use Illuminate\Database\Query\Builder;
65
use stdClass;
6+
use \Illuminate\Database\Query\Builder;
7+
use \Illuminate\Database\Eloquent\Builder as EloquentBuilder;
78
use timgws\QBParseException;
89

910
class JoinSupportingQueryBuilderParser extends QueryBuilderParser
@@ -42,15 +43,15 @@ public function __construct(array $fields = null, array $joinFields = null)
4243
* Make sure that all the correct fields are in the rule object then add the expression to
4344
* the query that was given by the user to the QueryBuilder.
4445
*
45-
* @param Builder $query
46-
* @param stdClass $rule
47-
* @param string $queryCondition the condition that will be used in the query
46+
* @param EloquentBuilder|Builder $query
47+
* @param stdClass $rule
48+
* @param string $queryCondition the condition that will be used in the query
4849
*
4950
* @throws QBParseException
5051
*
51-
* @return Builder
52+
* @return EloquentBuilder|Builder
5253
*/
53-
protected function makeQuery(Builder $query, stdClass $rule, $queryCondition = 'AND')
54+
protected function makeQuery(EloquentBuilder|Builder $query, stdClass $rule, $queryCondition = 'AND')
5455
{
5556
/*
5657
* Ensure that the value is correct for the rule, return query on exception
@@ -73,10 +74,10 @@ protected function makeQuery(Builder $query, stdClass $rule, $queryCondition = '
7374
/**
7475
* Build a subquery clause if there are join fields that have been specified.
7576
*
76-
* @param Builder $query
77+
* @param EloquentBuilder|Builder $query
7778
* @param stdClass $rule
7879
* @param string|null $value
79-
* @return Builder the query builder object
80+
* @return EloquentBuilder|Builder the query builder object
8081
*/
8182
private function buildSubclauseQuery($query, $rule, $value, $condition)
8283
{
@@ -129,7 +130,7 @@ function(Builder $query) use ($subclause) {
129130
* @param Builder $query
130131
* @return Builder the query builder object
131132
*/
132-
private function buildSubclauseInnerQuery($subclause, Builder $query)
133+
private function buildSubclauseInnerQuery($subclause, EloquentBuilder|Builder $query)
133134
{
134135
if ($subclause['require_array']) {
135136
return $this->buildRequireArrayQuery($subclause, $query);

0 commit comments

Comments
 (0)