Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22421532
ArcanistConcatenationOperatorXHPASTLinterRule.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
1 KB
Referenced Files
None
Subscribers
None
ArcanistConcatenationOperatorXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistConcatenationOperatorXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
44
;
public
function
getLintName
()
{
return
pht
(
'Concatenation Spacing'
);
}
public
function
getLintSeverity
()
{
return
ArcanistLintSeverity
::
SEVERITY_WARNING
;
}
public
function
process
(
XHPASTNode
$root
)
{
$tokens
=
$root
->
selectTokensOfType
(
'.'
);
foreach
(
$tokens
as
$token
)
{
$prev
=
$token
->
getPrevToken
();
$next
=
$token
->
getNextToken
();
foreach
(
array
(
'prev'
=>
$prev
,
'next'
=>
$next
)
as
$wtoken
)
{
if
(
$wtoken
->
getTypeName
()
!==
'T_WHITESPACE'
)
{
continue
;
}
$value
=
$wtoken
->
getValue
();
if
(
strpos
(
$value
,
"
\n
"
)
!==
false
)
{
// If the whitespace has a newline, it's conventional.
continue
;
}
$next
=
$wtoken
->
getNextToken
();
if
(
$next
&&
$next
->
getTypeName
()
===
'T_COMMENT'
)
{
continue
;
}
$this
->
raiseLintAtToken
(
$wtoken
,
pht
(
'Convention: no spaces around string concatenation operator.'
),
''
);
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 28, 03:11 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1206302
Default Alt Text
ArcanistConcatenationOperatorXHPASTLinterRule.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline