1 | <?php |
||
13 | class Localization |
||
14 | { |
||
15 | |||
16 | /** |
||
17 | * Localization constructor. |
||
18 | * |
||
19 | * @param \Illuminate\Foundation\Application $app |
||
20 | */ |
||
21 | public function __construct(Application $app) |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Handle an incoming request. |
||
29 | * |
||
30 | * @param \Illuminate\Http\Request $request |
||
31 | * @param \Closure $next |
||
32 | * |
||
33 | * @return mixed |
||
34 | */ |
||
35 | public function handle($request, Closure $next) |
||
52 | |||
53 | /** |
||
54 | * @param $lang |
||
55 | * |
||
56 | * @return string|Exception |
||
57 | */ |
||
58 | private function validateLanguage($lang) |
||
68 | |||
69 | /** |
||
70 | * @param $request |
||
71 | * |
||
72 | * @return string |
||
73 | */ |
||
74 | private function findLanguage($request) |
||
79 | |||
80 | /** |
||
81 | * @return array |
||
82 | */ |
||
83 | private function getSupportedLanguages() |
||
87 | |||
88 | } |
||
89 |
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: