Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/ArcanistBaseXHPASTLinter.php
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | /* -( Sharing Parse Trees )------------------------------------------------ */ | ||||
/** | /** | ||||
* Get a path's tree from the responsible linter. | * Get a path's tree from the responsible linter. | ||||
* | * | ||||
* @param string Path to retrieve tree for. | * @param string Path to retrieve tree for. | ||||
* @return XHPASTTree|null Tree, or null if unparseable. | * @return XHPASTTree|null Tree, or null if unparseable. | ||||
* @task sharing | * @task sharing | ||||
*/ | */ | ||||
protected function getXHPASTTreeForPath($path) { | protected function getXHPASTTreeForPath($path) { | ||||
echo "getXHPASTTreeForPath: {$path}\n"; | |||||
// If we aren't the linter responsible for actually building the parse | // If we aren't the linter responsible for actually building the parse | ||||
// trees, go get the tree from that linter. | // trees, go get the tree from that linter. | ||||
if ($this->getXHPASTLinter() !== $this) { | if ($this->getXHPASTLinter() !== $this) { | ||||
return $this->getXHPASTLinter()->getXHPASTTreeForPath($path); | return $this->getXHPASTLinter()->getXHPASTTreeForPath($path); | ||||
} | } | ||||
if (!array_key_exists($path, $this->trees)) { | if (!array_key_exists($path, $this->trees)) { | ||||
Show All 24 Lines | /* -( Sharing Parse Trees )------------------------------------------------ */ | ||||
protected function getXHPASTExceptionForPath($path) { | protected function getXHPASTExceptionForPath($path) { | ||||
if ($this->getXHPASTLinter() !== $this) { | if ($this->getXHPASTLinter() !== $this) { | ||||
return $this->getXHPASTLinter()->getXHPASTExceptionForPath($path); | return $this->getXHPASTLinter()->getXHPASTExceptionForPath($path); | ||||
} | } | ||||
return idx($this->exceptions, $path); | return idx($this->exceptions, $path); | ||||
} | } | ||||
public function didLintPath($path) { | |||||
echo "didLintPath: {$path}\n"; | |||||
if (idx($this->trees, $path)) { | |||||
unset($this->trees[$path]); | |||||
} | |||||
} | |||||
} | } |