mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-01-10 23:01:04 +01:00
5aa3bc6ec0
Summary: Also provides an example how to build custom linter using XHPAST. Test Plan: Added debug output to `willLintPaths()`, verified that each path is parsed only once. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4718
34 lines
596 B
PHP
34 lines
596 B
PHP
<?php
|
|
|
|
/**
|
|
* @group linter
|
|
*/
|
|
abstract class ArcanistBaseXHPASTLinter extends ArcanistLinter {
|
|
|
|
protected function raiseLintAtToken(
|
|
XHPASTToken $token,
|
|
$code,
|
|
$desc,
|
|
$replace = null) {
|
|
return $this->raiseLintAtOffset(
|
|
$token->getOffset(),
|
|
$code,
|
|
$desc,
|
|
$token->getValue(),
|
|
$replace);
|
|
}
|
|
|
|
protected function raiseLintAtNode(
|
|
XHPASTNode $node,
|
|
$code,
|
|
$desc,
|
|
$replace = null) {
|
|
return $this->raiseLintAtOffset(
|
|
$node->getOffset(),
|
|
$code,
|
|
$desc,
|
|
$node->getConcreteString(),
|
|
$replace);
|
|
}
|
|
|
|
}
|