Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22406710
ArcanistUseStatementNamespacePrefixXHPASTLinterRule.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
943 B
Referenced Files
None
Subscribers
None
ArcanistUseStatementNamespacePrefixXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistUseStatementNamespacePrefixXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
97
;
public
function
getLintName
()
{
return
pht
(
'`%s` Statement Namespace Prefix'
,
'use'
);
}
public
function
getLintSeverity
()
{
return
ArcanistLintSeverity
::
SEVERITY_WARNING
;
}
public
function
process
(
XHPASTNode
$root
)
{
$use_lists
=
$root
->
selectDescendantsOfType
(
'n_USE_LIST'
);
foreach
(
$use_lists
as
$use_list
)
{
$uses
=
$use_list
->
selectDescendantsOfType
(
'n_USE'
);
foreach
(
$uses
as
$use
)
{
$symbol
=
$use
->
getChildOfType
(
0
,
'n_SYMBOL_NAME'
);
$symbol_name
=
$symbol
->
getConcreteString
();
if
(
$symbol_name
[
0
]
==
'
\\
'
)
{
$this
->
raiseLintAtNode
(
$symbol
,
pht
(
'Imported symbols should not be prefixed with `%s`.'
,
'
\\
'
),
substr
(
$symbol_name
,
1
));
}
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 20:21 (4 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1223229
Default Alt Text
ArcanistUseStatementNamespacePrefixXHPASTLinterRule.php (943 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline