Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22393511
ArcanistInlineHTMLXHPASTLinterRule.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
744 B
Referenced Files
None
Subscribers
None
ArcanistInlineHTMLXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistInlineHTMLXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
78
;
public
function
getLintName
()
{
return
pht
(
'Inline HTML'
);
}
public
function
getLintSeverity
()
{
return
ArcanistLintSeverity
::
SEVERITY_DISABLED
;
}
public
function
process
(
XHPASTNode
$root
)
{
$inline_html
=
$root
->
selectTokensOfType
(
'T_INLINE_HTML'
);
foreach
(
$inline_html
as
$html
)
{
if
(
substr
(
$html
->
getValue
(),
0
,
2
)
==
'#!'
)
{
// Ignore shebang lines.
continue
;
}
if
(
preg_match
(
'/^
\s
*$/'
,
$html
->
getValue
()))
{
continue
;
}
$this
->
raiseLintAtToken
(
$html
,
pht
(
'PHP files must only contain PHP code.'
));
break
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 16:06 (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1208860
Default Alt Text
ArcanistInlineHTMLXHPASTLinterRule.php (744 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline