Changeset View
Changeset View
Standalone View
Standalone View
src/lint/linter/xhpast/rules/ArcanistDeprecationXHPASTLinterRule.php
| Show All 31 Lines | switch ($key) { | ||||
| return; | return; | ||||
| default: | default: | ||||
| return parent::getLinterConfigurationOptions(); | return parent::getLinterConfigurationOptions(); | ||||
| } | } | ||||
| } | } | ||||
| public function process(XHPASTNode $root) { | public function process(XHPASTNode $root) { | ||||
| $map = $this->deprecatedFunctions; | $map = new CaseInsensitiveArray($this->deprecatedFunctions); | ||||
| $function_calls = $this->getFunctionCalls($root, array_keys($map)); | |||||
| $function_calls = $this->getFunctionCalls( | |||||
| $root, | |||||
| array_keys($this->deprecatedFunctions)); | |||||
joshuaspence: We should probably modify the `getFunctionCalls` method to do this. | |||||
| foreach ($function_calls as $call) { | foreach ($function_calls as $call) { | ||||
| $name = $call | $name = $call | ||||
| ->getChildByIndex(0) | ->getChildByIndex(0) | ||||
| ->getConcreteString(); | ->getConcreteString(); | ||||
| $name = strtolower($name); | |||||
| if (empty($map[$name])) { | if (empty($map[$name])) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $this->raiseLintAtNode($call, $map[$name]); | $this->raiseLintAtNode($call, $map[$name]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
We should probably modify the getFunctionCalls method to do this.