1 | <?php |
||
18 | class RevisionLog |
||
19 | { |
||
20 | |||
21 | const CACHE_FORMAT_VERSION = 1; |
||
22 | |||
23 | /** |
||
24 | * Repository path. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | private $_repositoryUrl; |
||
29 | |||
30 | /** |
||
31 | * Repository connector. |
||
32 | * |
||
33 | * @var Connector |
||
34 | */ |
||
35 | private $_repositoryConnector; |
||
36 | |||
37 | /** |
||
38 | * Cache manager. |
||
39 | * |
||
40 | * @var CacheManager |
||
41 | */ |
||
42 | private $_cacheManager; |
||
43 | |||
44 | /** |
||
45 | * Console IO. |
||
46 | * |
||
47 | * @var ConsoleIO |
||
48 | */ |
||
49 | private $_io; |
||
50 | |||
51 | /** |
||
52 | * Installed plugins. |
||
53 | * |
||
54 | * @var IRevisionLogPlugin[] |
||
55 | */ |
||
56 | private $_plugins = array(); |
||
57 | |||
58 | /** |
||
59 | * Create revision log. |
||
60 | * |
||
61 | * @param string $repository_url Repository url. |
||
62 | * @param Connector $repository_connector Repository connector. |
||
63 | * @param CacheManager $cache_manager Cache. |
||
64 | * @param ConsoleIO $io Console IO. |
||
65 | */ |
||
66 | 18 | public function __construct( |
|
77 | |||
78 | /** |
||
79 | * Queries missing revisions. |
||
80 | * |
||
81 | * @return void |
||
82 | * @throws \LogicException When no plugins are registered. |
||
83 | */ |
||
84 | 10 | public function refresh() |
|
125 | |||
126 | /** |
||
127 | * Returns format version. |
||
128 | * |
||
129 | * @return mixed |
||
130 | */ |
||
131 | 9 | private function _getCacheInvalidator() |
|
144 | |||
145 | /** |
||
146 | * Returns last known revision. |
||
147 | * |
||
148 | * @return integer |
||
149 | */ |
||
150 | 9 | private function _getLastRevision() |
|
164 | |||
165 | /** |
||
166 | * Queries missing revision data. |
||
167 | * |
||
168 | * @param integer $from_revision From revision. |
||
169 | * @param integer $to_revision To revision. |
||
170 | * |
||
171 | * @return void |
||
172 | */ |
||
173 | 2 | private function _queryRevisionData($from_revision, $to_revision) |
|
209 | |||
210 | /** |
||
211 | * Parses output of "svn log" command. |
||
212 | * |
||
213 | * @param \SimpleXMLElement $log Log. |
||
214 | * |
||
215 | * @return void |
||
216 | */ |
||
217 | 2 | private function _parseLog(\SimpleXMLElement $log) |
|
223 | |||
224 | /** |
||
225 | * Registers a plugin. |
||
226 | * |
||
227 | * @param IRevisionLogPlugin $plugin Plugin. |
||
228 | * |
||
229 | * @return void |
||
230 | * @throws \LogicException When plugin is registered several times. |
||
231 | */ |
||
232 | 15 | public function registerPlugin(IRevisionLogPlugin $plugin) |
|
242 | |||
243 | /** |
||
244 | * Finds information using plugin. |
||
245 | * |
||
246 | * @param string $plugin_name Plugin name. |
||
247 | * @param array|string $criteria Search criteria. |
||
248 | * |
||
249 | * @return array |
||
250 | * @throws \InvalidArgumentException When unknown plugin is given. |
||
251 | */ |
||
252 | 3 | public function find($plugin_name, $criteria) |
|
260 | |||
261 | /** |
||
262 | * Returns information about revisions. |
||
263 | * |
||
264 | * @param string $plugin_name Plugin name. |
||
265 | * @param array $revisions Revisions. |
||
266 | * |
||
267 | * @return array |
||
268 | * @throws \InvalidArgumentException When unknown plugin is given. |
||
269 | */ |
||
270 | 3 | public function getRevisionsData($plugin_name, array $revisions) |
|
278 | |||
279 | /** |
||
280 | * Determines if plugin is registered. |
||
281 | * |
||
282 | * @param string $plugin_name Plugin name. |
||
283 | * |
||
284 | * @return boolean |
||
285 | */ |
||
286 | 17 | public function pluginRegistered($plugin_name) |
|
290 | |||
291 | /** |
||
292 | * Returns bugs, from revisions. |
||
293 | * |
||
294 | * @param array $revisions Revisions. |
||
295 | * |
||
296 | * @return array |
||
297 | */ |
||
298 | 1 | public function getBugsFromRevisions(array $revisions) |
|
313 | |||
314 | } |
||
315 |
This check looks at variables that are passed out again to other methods.
If the outgoing method call has stricter type requirements than the method itself, an issue is raised.
An additional type check may prevent trouble.