Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3282054
ArcanistInterfaceMethodBodyXHPASTLinterRule.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
843 B
Referenced Files
None
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
(
5
)
;
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
Mon, Mar 24, 04:03 (1 d, 1 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1143141
Default Alt Text
ArcanistInterfaceMethodBodyXHPASTLinterRule.php (843 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment