1 | <?php |
||
16 | class LanguageDetector implements Detector |
||
17 | { |
||
18 | /* ----------------------------------------------------------------- |
||
19 | | Properties |
||
20 | | ----------------------------------------------------------------- |
||
21 | */ |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $languages; |
||
27 | |||
28 | /* ----------------------------------------------------------------- |
||
29 | | Getters & Setters |
||
30 | | ----------------------------------------------------------------- |
||
31 | */ |
||
32 | |||
33 | /** |
||
34 | * Get the languages. |
||
35 | * |
||
36 | * @return array |
||
37 | */ |
||
38 | 18 | public function languages(): array |
|
42 | |||
43 | /** |
||
44 | * Get the languages keys. |
||
45 | * |
||
46 | * @return array |
||
47 | */ |
||
48 | 18 | public function keys(): array |
|
52 | |||
53 | /* ----------------------------------------------------------------- |
||
54 | | Main Methods |
||
55 | | ----------------------------------------------------------------- |
||
56 | */ |
||
57 | |||
58 | /** |
||
59 | * Handle the given request. |
||
60 | * |
||
61 | * @param \Illuminate\Http\Request $request |
||
62 | * |
||
63 | * @return $this |
||
64 | */ |
||
65 | 372 | public function handle(Request $request): Detector |
|
76 | |||
77 | /* ----------------------------------------------------------------- |
||
78 | | Other Methods |
||
79 | | ----------------------------------------------------------------- |
||
80 | */ |
||
81 | |||
82 | /** |
||
83 | * Parse the accept language. |
||
84 | * |
||
85 | * @param string $acceptLanguage |
||
86 | */ |
||
87 | 372 | protected function parse(string $acceptLanguage): void |
|
100 | } |
||
101 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.