1 | <?php |
||
5 | abstract class Intl |
||
6 | { |
||
7 | /** |
||
8 | * Store previously used keywords in memory. |
||
9 | * |
||
10 | * @var array |
||
11 | */ |
||
12 | protected static $searchCache = []; |
||
13 | |||
14 | /** |
||
15 | * Get the current locale. |
||
16 | * |
||
17 | * @return string |
||
18 | */ |
||
19 | abstract public function getLocale(); |
||
20 | |||
21 | /** |
||
22 | * Set the current locale. |
||
23 | * |
||
24 | * @param $locale |
||
25 | * @return $this |
||
26 | */ |
||
27 | abstract public function setLocale($locale); |
||
28 | |||
29 | /** |
||
30 | * Get the fallback locale. |
||
31 | * |
||
32 | * @return string |
||
33 | */ |
||
34 | abstract public function getFallbackLocale(); |
||
35 | |||
36 | /** |
||
37 | * Set the fallback locale. |
||
38 | * |
||
39 | * @param $locale |
||
40 | * @return $this |
||
41 | */ |
||
42 | abstract public function setFallbackLocale($locale); |
||
43 | |||
44 | /** |
||
45 | * Get the search cache. |
||
46 | * |
||
47 | * @return array |
||
48 | */ |
||
49 | public function getSearchCache() |
||
53 | |||
54 | /** |
||
55 | * Forget the search cache as whole or by key. |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | public function forgetSearchCache($cacheKey = null) |
||
69 | |||
70 | /** |
||
71 | * Search the data by the given keywords. |
||
72 | * |
||
73 | * @param array|string $keywords |
||
74 | * @return array |
||
75 | */ |
||
76 | public function search($keywords) { |
||
105 | |||
106 | /** |
||
107 | * Parse the given keywords into include/exclude keywords. |
||
108 | * |
||
109 | * @param array|string $keywords |
||
110 | * @return array |
||
111 | */ |
||
112 | protected function parseKeywords($keywords) |
||
130 | |||
131 | /** |
||
132 | * Run the given callable while using another locale. |
||
133 | * |
||
134 | * @param string $locale |
||
135 | * @param callable $callback |
||
136 | * @param string|null $fallbackLocale |
||
137 | * @return mixed |
||
138 | */ |
||
139 | 12 | public function usingLocale($locale, callable $callback, $fallbackLocale = null) |
|
154 | } |
||
155 |
This check looks for variables that are accessed but have not been defined. It raises an issue if it finds another variable that has a similar name.
The variable may have been renamed without also renaming all references.