Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2680382
ArcanistDynamicDefineXHPASTLinterRule.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
682 B
Referenced Files
None
Subscribers
None
ArcanistDynamicDefineXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistDynamicDefineXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
12
;
public
function
getLintName
(
)
{
return
pht
(
'Dynamic `%s`'
,
'define'
)
;
}
public
function
process
(
XHPASTNode
$root
)
{
$calls
=
$this
->
getFunctionCalls
(
$root
,
array
(
'define'
)
)
;
foreach
(
$calls
as
$call
)
{
$parameter_list
=
$call
->
getChildOfType
(
1
,
'n_CALL_PARAMETER_LIST'
)
;
$defined
=
$parameter_list
->
getChildByIndex
(
0
)
;
if
(
!
$defined
->
isStaticScalar
(
)
)
{
$this
->
raiseLintAtNode
(
$defined
,
pht
(
'First argument to `%s` must be a string literal.'
,
'define'
)
)
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 19, 17:00 (21 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1014397
Default Alt Text
ArcanistDynamicDefineXHPASTLinterRule.php (682 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment