2
2
3
3
namespace timgws ;
4
4
5
- use Illuminate \Database \Query \Builder ;
6
5
use stdClass ;
6
+ use \Illuminate \Database \Query \Builder ;
7
+ use \Illuminate \Database \Eloquent \Builder as EloquentBuilder ;
7
8
use timgws \QBParseException ;
8
9
9
10
class JoinSupportingQueryBuilderParser extends QueryBuilderParser
@@ -42,15 +43,15 @@ public function __construct(array $fields = null, array $joinFields = null)
42
43
* Make sure that all the correct fields are in the rule object then add the expression to
43
44
* the query that was given by the user to the QueryBuilder.
44
45
*
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
48
49
*
49
50
* @throws QBParseException
50
51
*
51
- * @return Builder
52
+ * @return EloquentBuilder| Builder
52
53
*/
53
- protected function makeQuery (Builder $ query , stdClass $ rule , $ queryCondition = 'AND ' )
54
+ protected function makeQuery (EloquentBuilder | Builder $ query , stdClass $ rule , $ queryCondition = 'AND ' )
54
55
{
55
56
/*
56
57
* 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 = '
73
74
/**
74
75
* Build a subquery clause if there are join fields that have been specified.
75
76
*
76
- * @param Builder $query
77
+ * @param EloquentBuilder| Builder $query
77
78
* @param stdClass $rule
78
79
* @param string|null $value
79
- * @return Builder the query builder object
80
+ * @return EloquentBuilder| Builder the query builder object
80
81
*/
81
82
private function buildSubclauseQuery ($ query , $ rule , $ value , $ condition )
82
83
{
@@ -129,7 +130,7 @@ function(Builder $query) use ($subclause) {
129
130
* @param Builder $query
130
131
* @return Builder the query builder object
131
132
*/
132
- private function buildSubclauseInnerQuery ($ subclause , Builder $ query )
133
+ private function buildSubclauseInnerQuery ($ subclause , EloquentBuilder | Builder $ query )
133
134
{
134
135
if ($ subclause ['require_array ' ]) {
135
136
return $ this ->buildRequireArrayQuery ($ subclause , $ query );
0 commit comments