1 | <?php |
||
13 | class QueryBuilder extends Builder |
||
14 | { |
||
15 | use FiltersQuery, |
||
16 | SortsQuery, |
||
17 | AddsIncludesToQuery, |
||
18 | AddsFieldsToQuery, |
||
19 | AppendsAttributesToResults; |
||
20 | |||
21 | /** @var \Spatie\QueryBuilder\QueryBuilderRequest */ |
||
22 | protected $request; |
||
23 | |||
24 | protected $throwInvalidQueryExceptions = true; |
||
25 | |||
26 | /** |
||
27 | * QueryBuilder constructor. |
||
28 | * |
||
29 | * @param \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $builder |
||
30 | * @param null|\Illuminate\Http\Request $request |
||
31 | */ |
||
32 | public function __construct($builder, ?Request $request = null) |
||
42 | |||
43 | /** |
||
44 | * Create a new QueryBuilder for a request and model. |
||
45 | * |
||
46 | * @param string|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Relations\Relation $baseQuery Model class or base query builder |
||
47 | * @param \Illuminate\Http\Request $request |
||
48 | * |
||
49 | * @return \Spatie\QueryBuilder\QueryBuilder |
||
50 | */ |
||
51 | public static function for($baseQuery, ?Request $request = null): self |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function get($columns = ['*']) |
||
74 | |||
75 | /** |
||
76 | * Add the model, scopes, eager loaded relationships, local macro's and onDelete callback |
||
77 | * from the $builder to this query builder. |
||
78 | * |
||
79 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
80 | */ |
||
81 | protected function initializeFromBuilder(Builder $builder) |
||
97 | |||
98 | public function setThrowInvalidQueryExceptions(bool $throwInvalidQueryExceptions = true): self |
||
104 | |||
105 | public function disableInvalidQueryExceptions(): self |
||
109 | } |
||
110 |
This check looks at variables that have been passed in as parameters and are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.