1 | <?php |
||
14 | class StopwordAnalyzer { |
||
15 | |||
16 | /** |
||
17 | * Any change to the content of its data files should be reflected in a |
||
18 | * version change (the version number does not necessarily correlate with |
||
19 | * the library version) |
||
20 | */ |
||
21 | const VERSION = '0.1.3'; |
||
22 | |||
23 | /** |
||
24 | * Prefix |
||
25 | */ |
||
26 | const CACHE = 'onoi:tesa:stopword:'; |
||
27 | |||
28 | /** |
||
29 | * @var Cache |
||
30 | */ |
||
31 | private $cache; |
||
32 | |||
33 | /** |
||
34 | * @var integer |
||
35 | */ |
||
36 | private $ttl = 3600; |
||
37 | |||
38 | /** |
||
39 | * @var array|null |
||
40 | */ |
||
41 | private static $internalLookupCache = null; |
||
42 | |||
43 | /** |
||
44 | * @var array |
||
45 | */ |
||
46 | private $languageList = array(); |
||
47 | |||
48 | /** |
||
49 | * @since 0.1 |
||
50 | * |
||
51 | * @param Cache|null $cache |
||
52 | * @param integer $ttl |
||
53 | */ |
||
54 | 16 | public function __construct( Cache $cache = null, $ttl = 3600 ) { |
|
65 | |||
66 | /** |
||
67 | * @since 0.1 |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | 2 | public function getLanguageList() { |
|
74 | |||
75 | /** |
||
76 | * @since 0.1 |
||
77 | * |
||
78 | * @param integer $flag |
||
|
|||
79 | */ |
||
80 | 6 | public function loadListByDefaultLanguages() { |
|
84 | |||
85 | /** |
||
86 | * @since 0.1 |
||
87 | * |
||
88 | * @param string $location |
||
89 | * @param string|array $languageCode |
||
90 | */ |
||
91 | 1 | public function loadListFromCustomLocation( $location, $languageCode ) { |
|
100 | |||
101 | /** |
||
102 | * @since 0.1 |
||
103 | * |
||
104 | * @param string|array $languageCode |
||
105 | */ |
||
106 | 13 | public function loadListByLanguage( $languageCode ) { |
|
115 | |||
116 | /** |
||
117 | * The expected form is array( $languageCode => array( 'foo', 'bar' ) ) |
||
118 | * |
||
119 | * @since 0.1 |
||
120 | * |
||
121 | * @param array $customStopwordList |
||
122 | */ |
||
123 | 1 | public function setCustomStopwordList( array $customStopwordList ) { |
|
135 | |||
136 | /** |
||
137 | * @since 0.1 |
||
138 | * |
||
139 | * @param string $word |
||
140 | * |
||
141 | * @return boolean |
||
142 | */ |
||
143 | 14 | public function isStopWord( $word ) { |
|
146 | |||
147 | 14 | private function loadListFromCache( $location, $languages ) { |
|
173 | |||
174 | } |
||
175 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.