Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F20320985
ArcanistInterfaceMethodBodyXHPASTLinterRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
843 B
Subscribers
None
ArcanistInterfaceMethodBodyXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistInterfaceMethodBodyXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
114
;
public
function
getLintName
()
{
return
pht
(
'`%s` Method Cannot Contain Body'
,
'interface'
);
}
public
function
process
(
XHPASTNode
$root
)
{
$interfaces
=
$root
->
selectDescendantsOfType
(
'n_INTERFACE_DECLARATION'
);
foreach
(
$interfaces
as
$interface
)
{
$methods
=
$interface
->
selectDescendantsOfType
(
'n_METHOD_DECLARATION'
);
foreach
(
$methods
as
$method
)
{
$body
=
$method
->
getChildByIndex
(
6
);
if
(
$body
->
getTypeName
()
!=
'n_EMPTY'
)
{
$this
->
raiseLintAtNode
(
$body
,
pht
(
'`%s` methods cannot contain a body. This construct will '
.
'cause a fatal error.'
,
'interface'
));
}
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Mar 14, 4:56 AM (6 m, 15 s)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3e/88/48a9ba8ddf0126de92b1cc6885db
Attached To
rARC Arcanist
Event Timeline
Log In to Comment