1 | <?php |
||
11 | class Select extends Query |
||
12 | { |
||
13 | use Traits\HasRelatedWith; |
||
14 | use Traits\HasPagination; |
||
15 | use Traits\HasJoinRelation; |
||
16 | |||
17 | private $one; |
||
18 | protected const ALLOWED_METHODS = [ |
||
19 | 'from', |
||
20 | 'columns', |
||
21 | 'join', |
||
22 | 'catJoin', |
||
23 | 'groupBy', |
||
24 | 'having', |
||
25 | 'orHaving', |
||
26 | 'orderBy', |
||
27 | 'catHaving', |
||
28 | 'where', |
||
29 | 'whereEquals', |
||
30 | 'orWhere', |
||
31 | 'catWhere', |
||
32 | 'limit', |
||
33 | 'offset', |
||
34 | 'distinct', |
||
35 | 'forUpdate', |
||
36 | 'setFlag', |
||
37 | 'bindValue', |
||
38 | ]; |
||
39 | |||
40 | public function __construct(Table $table) |
||
52 | |||
53 | public function one(): self |
||
60 | |||
61 | public function run() |
||
73 | |||
74 | public function getArray(): ?array |
||
85 | |||
86 | private function createRow(array $data): Row |
||
95 | } |
||
96 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: