Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3281617
ArcanistEmptyFileXHPASTLinterRule.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
680 B
Referenced Files
None
Subscribers
None
ArcanistEmptyFileXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistEmptyFileXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
82
;
public
function
getLintName
(
)
{
return
pht
(
'Empty File'
)
;
}
public
function
getLintSeverity
(
)
{
return
ArcanistLintSeverity
::
SEVERITY_WARNING
;
}
public
function
process
(
XHPASTNode
$root
)
{
$tokens
=
$root
->
getTokens
(
)
;
foreach
(
$tokens
as
$token
)
{
switch
(
$token
->
getTypeName
(
)
)
{
case
'T_OPEN_TAG'
:
case
'T_CLOSE_TAG'
:
case
'T_WHITESPACE'
:
break
;
default
:
return
;
}
}
$this
->
raiseLintAtPath
(
pht
(
"Empty files usually don't serve any useful purpose."
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Mar 23, 23:58 (1 d, 5 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1121247
Default Alt Text
ArcanistEmptyFileXHPASTLinterRule.php (680 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment