Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22422461
ArcanistDeprecationXHPASTLinterRule.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
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 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
Sat, Nov 28, 03:22 (1 d, 10 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1219799
Default Alt Text
ArcanistDeprecationXHPASTLinterRule.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline