Page MenuHomePhorge

ArcanistParseStrUseXHPASTLinterRule.php
No OneTemporary

ArcanistParseStrUseXHPASTLinterRule.php

<?php
final class ArcanistParseStrUseXHPASTLinterRule
extends ArcanistXHPASTLinterRule {
const ID = 80;
public function getLintName() {
return pht('Questionable Use of `%s`', 'parse_str');
}
public function process(XHPASTNode $root) {
$calls = $this->getFunctionCalls($root, array('parse_str'));
foreach ($calls as $call) {
$call_params = $call->getChildOfType(1, 'n_CALL_PARAMETER_LIST');
if (count($call_params->getChildren()) < 2) {
$this->raiseLintAtNode(
$call,
pht(
'Avoid `%s` unless the second parameter is specified. '.
'It is confusing and hinders static analysis.',
'parse_str'));
}
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Jan 19 2025, 19:48 (5 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1121021
Default Alt Text
ArcanistParseStrUseXHPASTLinterRule.php (717 B)

Event Timeline