Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22397161
ArcanistParseStrUseXHPASTLinterRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
717 B
Referenced Files
None
Subscribers
None
ArcanistParseStrUseXHPASTLinterRule.php
View Options
<?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
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 17:06 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1208696
Default Alt Text
ArcanistParseStrUseXHPASTLinterRule.php (717 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline