| 1 | <?php |
||
| 7 | class ModelsExist implements Rule |
||
| 8 | { |
||
| 9 | /** @var string */ |
||
| 10 | protected $modelClassName; |
||
| 11 | |||
| 12 | /** @var string */ |
||
| 13 | protected $modelAttribute; |
||
| 14 | |||
| 15 | /** @var string */ |
||
| 16 | protected $attribute; |
||
| 17 | |||
| 18 | /** @var array */ |
||
| 19 | protected $modelIds; |
||
| 20 | |||
| 21 | 18 | public function __construct(string $modelClassName, string $attribute = 'id') |
|
| 27 | |||
| 28 | 18 | public function passes($attribute, $value): bool |
|
| 40 | |||
| 41 | 6 | public function message(): string |
|
| 54 | } |
||
| 55 |
Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.