1 | <?php |
||
14 | class DynamicRoute extends Model |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Mass assignment protection - fillable fields |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $fillable = [ |
||
22 | 'method', |
||
23 | 'name', |
||
24 | 'pattern', |
||
25 | 'handler', |
||
26 | 'configuration' |
||
27 | ]; |
||
28 | |||
29 | /** |
||
30 | * Validation rules. |
||
31 | * @var array |
||
32 | */ |
||
33 | public static $validation = [ |
||
34 | 'method' => ['required'], |
||
35 | 'name' => ['required'], |
||
36 | 'pattern' => ['required'], |
||
37 | 'handler' => ['required'] |
||
38 | ]; |
||
39 | |||
40 | /** |
||
41 | * @var array |
||
42 | */ |
||
43 | protected $casts = [ |
||
44 | 'configuration' => 'array', |
||
45 | ]; |
||
46 | |||
47 | /** |
||
48 | * Saves the route if valid. |
||
49 | * @param array $options |
||
50 | * @return bool |
||
51 | * @throws BasicValidationFailedForRouteException |
||
52 | * @throws HandlerNotFoundException |
||
53 | * @throws HandlerValidationFailedForRouteException |
||
54 | */ |
||
55 | public function save(array $options = []) |
||
70 | |||
71 | } |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.