Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2889745
ArcanistListAssignmentXHPASTLinterRule.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
868 B
Referenced Files
None
Subscribers
None
ArcanistListAssignmentXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistListAssignmentXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
77
;
public
function
getLintName
(
)
{
return
pht
(
'List Assignment'
)
;
}
public
function
getLintSeverity
(
)
{
return
ArcanistLintSeverity
::
SEVERITY_WARNING
;
}
public
function
process
(
XHPASTNode
$root
)
{
$assignment_lists
=
$root
->
selectDescendantsOfType
(
'n_ASSIGNMENT_LIST'
)
;
foreach
(
$assignment_lists
as
$assignment_list
)
{
$tokens
=
array_slice
(
$assignment_list
->
getTokens
(
)
,
1
,
-
1
)
;
foreach
(
array_reverse
(
$tokens
)
as
$token
)
{
if
(
$token
->
getTypeName
(
)
==
','
)
{
$this
->
raiseLintAtToken
(
$token
,
pht
(
'Unnecessary comma in list assignment.'
)
,
''
)
;
continue
;
}
if
(
$token
->
isSemantic
(
)
)
{
break
;
}
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 12:35 (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1120778
Default Alt Text
ArcanistListAssignmentXHPASTLinterRule.php (868 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment