Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2890348
ArcanistLowercaseFunctionsXHPASTLinterRule.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
ArcanistLowercaseFunctionsXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistLowercaseFunctionsXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
61
;
public
function
getLintName
(
)
{
return
pht
(
'Lowercase Functions'
)
;
}
public
function
getLintSeverity
(
)
{
return
ArcanistLintSeverity
::
SEVERITY_ADVICE
;
}
public
function
process
(
XHPASTNode
$root
)
{
static
$builtin_functions
=
null
;
if
(
$builtin_functions
===
null
)
{
$builtin_functions
=
array_fuse
(
idx
(
get_defined_functions
(
)
,
'internal'
,
array
(
)
)
)
;
}
$function_calls
=
$root
->
selectDescendantsOfType
(
'n_FUNCTION_CALL'
)
;
foreach
(
$function_calls
as
$function_call
)
{
$function
=
$function_call
->
getChildByIndex
(
0
)
;
if
(
$function
->
getTypeName
(
)
!=
'n_SYMBOL_NAME'
)
{
continue
;
}
$function_name
=
$function
->
getConcreteString
(
)
;
if
(
!
idx
(
$builtin_functions
,
strtolower
(
$function_name
)
)
)
{
continue
;
}
if
(
$function_name
!=
strtolower
(
$function_name
)
)
{
$this
->
raiseLintAtNode
(
$function
,
pht
(
'Calls to built-in PHP functions should be lowercase.'
)
,
strtolower
(
$function_name
)
)
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 13:26 (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1113772
Default Alt Text
ArcanistLowercaseFunctionsXHPASTLinterRule.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment