Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889537
ArcanistBlacklistedFunctionXHPASTLinterRule.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
1 KB
Referenced Files
None
Subscribers
None
ArcanistBlacklistedFunctionXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistBlacklistedFunctionXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
51
;
private
$blacklistedFunctions
=
array
(
)
;
public
function
getLintName
(
)
{
return
pht
(
'Use of Blacklisted Function'
)
;
}
public
function
getLinterConfigurationOptions
(
)
{
return
parent
::
getLinterConfigurationOptions
(
)
+
array
(
'xhpast.blacklisted.function'
=>
array
(
'type'
=>
'optional map<string, string>'
,
'help'
=>
pht
(
'Blacklisted functions which should not be used.'
)
,
)
,
)
;
}
public
function
setLinterConfigurationValue
(
$key
,
$value
)
{
switch
(
$key
)
{
case
'xhpast.blacklisted.function'
:
$this
->
blacklistedFunctions
=
$value
;
return
;
default
:
return
parent
::
getLinterConfigurationOptions
(
)
;
}
}
public
function
process
(
XHPASTNode
$root
)
{
$calls
=
$root
->
selectDescendantsOfType
(
'n_FUNCTION_CALL'
)
;
foreach
(
$calls
as
$call
)
{
$node
=
$call
->
getChildByIndex
(
0
)
;
$name
=
$node
->
getConcreteString
(
)
;
$reason
=
idx
(
$this
->
blacklistedFunctions
,
$name
)
;
if
(
$reason
)
{
$this
->
raiseLintAtNode
(
$node
,
$reason
)
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 12:19 (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1121093
Default Alt Text
ArcanistBlacklistedFunctionXHPASTLinterRule.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment