| 1 | <?php  | 
            ||
| 11 | final class Select implements QueryInterface  | 
            ||
| 12 | { | 
            ||
| 13 | use Traits\Common;  | 
            ||
| 14 | use Traits\HasRelatedWith;  | 
            ||
| 15 | use Traits\HasPagination;  | 
            ||
| 16 | use Traits\HasJoinRelation;  | 
            ||
| 17 | |||
| 18 | private $one;  | 
            ||
| 19 | private $allowedMethods = [  | 
            ||
| 20 | 'from',  | 
            ||
| 21 | 'columns',  | 
            ||
| 22 | 'join',  | 
            ||
| 23 | 'catJoin',  | 
            ||
| 24 | 'groupBy',  | 
            ||
| 25 | 'having',  | 
            ||
| 26 | 'orHaving',  | 
            ||
| 27 | 'orderBy',  | 
            ||
| 28 | 'catHaving',  | 
            ||
| 29 | 'where',  | 
            ||
| 30 | 'orWhere',  | 
            ||
| 31 | 'catWhere',  | 
            ||
| 32 | 'limit',  | 
            ||
| 33 | 'offset',  | 
            ||
| 34 | 'distinct',  | 
            ||
| 35 | 'forUpdate',  | 
            ||
| 36 | 'setFlag',  | 
            ||
| 37 | ];  | 
            ||
| 38 | |||
| 39 | public function __construct(Table $table)  | 
            ||
| 51 | |||
| 52 | public function one(): self  | 
            ||
| 59 | |||
| 60 | public function run()  | 
            ||
| 77 | |||
| 78 | private function createRow(array $data): Row  | 
            ||
| 94 | }  | 
            ||
| 95 | 
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: