Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3282052
ArcanistDeprecationXHPASTLinterRule.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
ArcanistDeprecationXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistDeprecationXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
85
;
private
$deprecatedFunctions
=
array
(
)
;
public
function
getLintName
(
)
{
return
pht
(
'Use of Deprecated Function'
)
;
}
public
function
getLintSeverity
(
)
{
return
ArcanistLintSeverity
::
SEVERITY_WARNING
;
}
public
function
getLinterConfigurationOptions
(
)
{
return
parent
::
getLinterConfigurationOptions
(
)
+
array
(
'xhpast.deprecated.functions'
=>
array
(
'type'
=>
'optional map<string, string>'
,
'help'
=>
pht
(
'Functions which should be considered deprecated.'
)
,
)
,
)
;
}
public
function
setLinterConfigurationValue
(
$key
,
$value
)
{
switch
(
$key
)
{
case
'xhpast.deprecated.functions'
:
$this
->
deprecatedFunctions
=
$value
;
return
;
default
:
return
parent
::
getLinterConfigurationOptions
(
)
;
}
}
public
function
process
(
XHPASTNode
$root
)
{
$map
=
$this
->
deprecatedFunctions
;
$function_calls
=
$this
->
getFunctionCalls
(
$root
,
array_keys
(
$map
)
)
;
foreach
(
$function_calls
as
$call
)
{
$name
=
$call
->
getChildByIndex
(
0
)
->
getConcreteString
(
)
;
$name
=
strtolower
(
$name
)
;
if
(
empty
(
$map
[
$name
]
)
)
{
continue
;
}
$this
->
raiseLintAtNode
(
$call
,
$map
[
$name
]
)
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Mar 24, 04:02 (1 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1120241
Default Alt Text
ArcanistDeprecationXHPASTLinterRule.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment