| 1 | <?php |
||
| 14 | class ThisUserCriteria extends Criteria |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | private $userId; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * ThisUserCriteria constructor. |
||
| 23 | * |
||
| 24 | * @param $userId |
||
| 25 | */ |
||
| 26 | public function __construct($userId = null) |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param $model |
||
| 33 | * @param \Prettus\Repository\Contracts\RepositoryInterface $repository |
||
| 34 | * |
||
| 35 | * @return mixed |
||
| 36 | */ |
||
| 37 | public function apply($model, PrettusRepositoryInterface $repository) |
||
| 45 | } |
||
| 46 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: