Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22419485
ArcanistDynamicDefineXHPASTLinterRule.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
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
Sat, Nov 28, 02:21 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1222402
Default Alt Text
ArcanistDynamicDefineXHPASTLinterRule.php (682 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline