Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22419592
ArcanistPHPOpenTagXHPASTLinterRule.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
805 B
Referenced Files
None
Subscribers
None
ArcanistPHPOpenTagXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistPHPOpenTagXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
15
;
public
function
getLintName
()
{
return
pht
(
'Expected Open Tag'
);
}
public
function
process
(
XHPASTNode
$root
)
{
$tokens
=
$root
->
getTokens
();
foreach
(
$tokens
as
$token
)
{
if
(
$token
->
getTypeName
()
===
'T_OPEN_TAG'
)
{
break
;
}
else
if
(
$token
->
getTypeName
()
===
'T_OPEN_TAG_WITH_ECHO'
)
{
break
;
}
else
{
if
(!
preg_match
(
'/^#!/'
,
$token
->
getValue
()))
{
$this
->
raiseLintAtToken
(
$token
,
pht
(
'PHP files should start with `%s`, which may be preceded by '
.
'a `%s` line for scripts.'
,
'<?php'
,
'#!'
));
}
break
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 28, 02:22 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1208631
Default Alt Text
ArcanistPHPOpenTagXHPASTLinterRule.php (805 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline