Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2890489
ArcanistObjectOperatorSpacingXHPASTLinterRule.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
ArcanistObjectOperatorSpacingXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistObjectOperatorSpacingXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
74
;
public
function
getLintName
(
)
{
return
pht
(
'Object Operator Spacing'
)
;
}
public
function
getLintSeverity
(
)
{
return
ArcanistLintSeverity
::
SEVERITY_WARNING
;
}
public
function
process
(
XHPASTNode
$root
)
{
$operators
=
$root
->
selectTokensOfType
(
'T_OBJECT_OPERATOR'
)
;
foreach
(
$operators
as
$operator
)
{
$before
=
$operator
->
getNonsemanticTokensBefore
(
)
;
$after
=
$operator
->
getNonsemanticTokensAfter
(
)
;
if
(
$before
)
{
$value
=
implode
(
''
,
mpull
(
$before
,
'getValue'
)
)
;
if
(
strpos
(
$value
,
"\n"
)
!==
false
)
{
continue
;
}
$this
->
raiseLintAtOffset
(
head
(
$before
)
->
getOffset
(
)
,
pht
(
'There should be no whitespace before the object operator.'
)
,
$value
,
''
)
;
}
if
(
$after
)
{
$this
->
raiseLintAtOffset
(
head
(
$after
)
->
getOffset
(
)
,
pht
(
'There should be no whitespace after the object operator.'
)
,
implode
(
''
,
mpull
(
$before
,
'getValue'
)
)
,
''
)
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 13:39 (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1121339
Default Alt Text
ArcanistObjectOperatorSpacingXHPASTLinterRule.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment