1 | <?php namespace Arcanedev\Settings\Http\Middleware; |
||
14 | class SettingsMiddleware |
||
15 | { |
||
16 | /* ------------------------------------------------------------------------------------------------ |
||
17 | | Constructor |
||
18 | | ------------------------------------------------------------------------------------------------ |
||
19 | */ |
||
20 | /** |
||
21 | * Create a new save settings middleware |
||
22 | * |
||
23 | * @param \Arcanedev\Settings\Contracts\Store $settings |
||
24 | */ |
||
25 | public function __construct(Settings $settings) |
||
29 | |||
30 | /* ------------------------------------------------------------------------------------------------ |
||
31 | | Main Functions |
||
32 | | ------------------------------------------------------------------------------------------------ |
||
33 | */ |
||
34 | /** |
||
35 | * Handle an incoming request. |
||
36 | * |
||
37 | * @param \Illuminate\Http\Request $request |
||
38 | * @param \Closure $next |
||
39 | * |
||
40 | * @return mixed |
||
41 | */ |
||
42 | public function handle(Request $request, Closure $next) |
||
46 | |||
47 | /** |
||
48 | * Perform any final actions for the request lifecycle. |
||
49 | * |
||
50 | * @param \Illuminate\Http\Request $request |
||
51 | * @param \Symfony\Component\HttpFoundation\Response $response |
||
52 | */ |
||
53 | public function terminate(Request $request, Response $response) |
||
57 | } |
||
58 |
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: