Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894380
ArcanistParseStrUseXHPASTLinterRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
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
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)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment