1 | <?php |
||
8 | class Authorized implements Rule |
||
9 | { |
||
10 | /** @var string */ |
||
11 | protected $ability; |
||
12 | |||
13 | /** @var array */ |
||
14 | protected $arguments; |
||
15 | |||
16 | 24 | public function __construct(string $ability, string $className) |
|
22 | |||
23 | 24 | public function passes($attribute, $value) |
|
35 | |||
36 | public function message() |
||
40 | } |
||
41 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: