Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2680360
ArcanistAbstractMethodBodyXHPASTLinterRule.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
765 B
Referenced Files
None
Subscribers
None
ArcanistAbstractMethodBodyXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistAbstractMethodBodyXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
108
;
public
function
getLintName
(
)
{
return
pht
(
'`%s` Method Cannot Contain Body'
,
'abstract'
)
;
}
public
function
process
(
XHPASTNode
$root
)
{
$methods
=
$root
->
selectDescendantsOfType
(
'n_METHOD_DECLARATION'
)
;
foreach
(
$methods
as
$method
)
{
$modifiers
=
$this
->
getModifiers
(
$method
)
;
$body
=
$method
->
getChildByIndex
(
6
)
;
if
(
idx
(
$modifiers
,
'abstract'
)
&&
$body
->
getTypeName
(
)
!=
'n_EMPTY'
)
{
$this
->
raiseLintAtNode
(
$body
,
pht
(
'`%s` methods cannot contain a body. This construct will '
.
'cause a fatal error.'
,
'abstract'
)
)
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Dec 19, 17:00 (22 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1014832
Default Alt Text
ArcanistAbstractMethodBodyXHPASTLinterRule.php (765 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment