Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22392297
ArcanistCommentStyleXHPASTLinterRule.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
604 B
Referenced Files
None
Subscribers
None
ArcanistCommentStyleXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistCommentStyleXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
18
;
public
function
getLintName
()
{
return
pht
(
'Comment Style'
);
}
public
function
process
(
XHPASTNode
$root
)
{
foreach
(
$root
->
selectTokensOfType
(
'T_COMMENT'
)
as
$comment
)
{
$value
=
$comment
->
getValue
();
if
(
$value
[
0
]
!==
'#'
)
{
continue
;
}
$this
->
raiseLintAtOffset
(
$comment
->
getOffset
(),
pht
(
'Use "%s" single-line comments, not "%s".'
,
'//'
,
'#'
),
'#'
,
preg_match
(
'/^#
\S
/'
,
$value
)
?
'// '
:
'//'
);
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 15:46 (1 d, 5 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1222615
Default Alt Text
ArcanistCommentStyleXHPASTLinterRule.php (604 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline