Summary: Fixes T5209. It makes sense for the `ArcanistXHPASTLinter` to implement the `getVersion` method in order to be able to enforce version requirements (as in T4954).
Test Plan: N/A
Reviewers: epriestley, #blessed_reviewers
Reviewed By: epriestley, #blessed_reviewers
Subscribers: epriestley, Korvin
Maniphest Tasks: T5209
Differential Revision: https://secure.phabricator.com/D9317
private $trees = array();
private $exceptions = array();
+ final public function getCacheVersion() {
+ $parts = array();
+
+ $parts[] = $this->getVersion();
+
+ $path = xhpast_get_binary_path();
+ if (Filesystem::pathExists($path)) {
+ $parts[] = md5_file($path);
+ }
+
+ return implode('-', $parts);
+ }
+
final protected function raiseLintAtToken(
XHPASTToken $token,
$code,
return 'phutil-xhpast';
}
- public function getCacheVersion() {
- $version = '2';
- $path = xhpast_get_binary_path();
- if (Filesystem::pathExists($path)) {
- $version .= '-'.md5_file($path);
- }
- return $version;
+ public function getVersion() {
+ // The version number should be incremented whenever a new rule is added.
+ return '2';
}
public function getLinterConfigurationOptions() {
return parent::setLinterConfigurationValue($key, $value);
}
- public function getCacheVersion() {
- $version = '5';
- $path = xhpast_get_binary_path();
- if (Filesystem::pathExists($path)) {
- $version .= '-'.md5_file($path);
- }
- return $version;
+ public function getVersion() {
+ // The version number should be incremented whenever a new rule is added.
+ return '5';
}
protected function resolveFuture($path, Future $future) {