1 | <?php namespace Arcanedev\NoCaptcha; |
||
11 | class NoCaptchaServiceProvider extends ServiceProvider |
||
12 | { |
||
13 | /* ------------------------------------------------------------------------------------------------ |
||
14 | | Properties |
||
15 | | ------------------------------------------------------------------------------------------------ |
||
16 | */ |
||
17 | /** |
||
18 | * Vendor name. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $vendor = 'arcanedev'; |
||
23 | |||
24 | /** |
||
25 | * Package name. |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $package = 'no-captcha'; |
||
30 | |||
31 | /* ------------------------------------------------------------------------------------------------ |
||
32 | | Getters & Setters |
||
33 | | ------------------------------------------------------------------------------------------------ |
||
34 | */ |
||
35 | /** |
||
36 | * Get the base path of the package. |
||
37 | * |
||
38 | * @return string |
||
39 | */ |
||
40 | 72 | public function getBasePath() |
|
44 | |||
45 | /* ------------------------------------------------------------------------------------------------ |
||
46 | | Main Functions |
||
47 | | ------------------------------------------------------------------------------------------------ |
||
48 | */ |
||
49 | /** |
||
50 | * Register the service provider. |
||
51 | */ |
||
52 | 72 | public function register() |
|
57 | |||
58 | /** |
||
59 | * Bootstrap the application events. |
||
60 | */ |
||
61 | 72 | public function boot() |
|
62 | { |
||
63 | 72 | parent::boot(); |
|
64 | |||
65 | 72 | $this->publishConfig(); |
|
|
|||
66 | 72 | $this->registerValidatorRules($this->app); |
|
67 | 72 | $this->registerFormMacros($this->app); |
|
68 | 72 | } |
|
69 | |||
70 | /** |
||
71 | * Get the services provided by the provider. |
||
72 | * |
||
73 | * @return array |
||
74 | */ |
||
75 | 12 | public function provides() |
|
82 | |||
83 | /* ------------------------------------------------------------------------------------------------ |
||
84 | | Other Functions |
||
85 | | ------------------------------------------------------------------------------------------------ |
||
86 | */ |
||
87 | /** |
||
88 | * Register NoCaptcha service. |
||
89 | */ |
||
90 | 72 | private function registerNoCaptcha() |
|
108 | |||
109 | /** |
||
110 | * Register Validator rules. |
||
111 | * |
||
112 | 72 | * @param \Illuminate\Foundation\Application $app |
|
113 | */ |
||
114 | 72 | private function registerValidatorRules($app) |
|
123 | |||
124 | 72 | /** |
|
125 | * Register Form Macros. |
||
126 | * |
||
127 | 36 | * @param \Illuminate\Foundation\Application $app |
|
128 | 36 | */ |
|
129 | private function registerFormMacros($app) |
||
137 | } |
||
138 |
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: