1 | <?php namespace Arcanedev\Support\Http; |
||
11 | abstract class FormRequest extends BaseFormRequest |
||
12 | { |
||
13 | /* ----------------------------------------------------------------- |
||
14 | | Main Methods |
||
15 | | ----------------------------------------------------------------- |
||
16 | */ |
||
17 | |||
18 | /** |
||
19 | * Determine if the user is authorized to make this request. |
||
20 | * |
||
21 | * @return bool |
||
22 | */ |
||
23 | 6 | public function authorize() |
|
24 | { |
||
25 | 6 | return true; |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * Get the validation rules that apply to the request. |
||
30 | * |
||
31 | * @return array |
||
32 | */ |
||
33 | abstract public function rules(); |
||
34 | |||
35 | /** |
||
36 | * Validate the class instance. |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | 6 | public function validateResolved() |
|
47 | } |
||
48 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: