Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3281990
ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule.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
1 KB
Referenced Files
None
Subscribers
None
ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
113
;
public
function
getLintName
(
)
{
return
pht
(
'`%s` Containing `%s` Methods Must Be Declared `%s`'
,
'class'
,
'abstract'
,
'abstract'
)
;
}
public
function
process
(
XHPASTNode
$root
)
{
$classes
=
$root
->
selectDescendantsOfType
(
'n_CLASS_DECLARATION'
)
;
foreach
(
$classes
as
$class
)
{
$class_modifiers
=
$this
->
getModifiers
(
$class
)
;
$abstract_methods
=
array
(
)
;
$methods
=
$class
->
selectDescendantsOfType
(
'n_METHOD_DECLARATION'
)
;
foreach
(
$methods
as
$method
)
{
$method_modifiers
=
$this
->
getModifiers
(
$method
)
;
if
(
idx
(
$method_modifiers
,
'abstract'
)
)
{
$abstract_methods
[
]
=
$method
;
}
}
if
(
!
idx
(
$class_modifiers
,
'abstract'
)
&&
$abstract_methods
)
{
$this
->
raiseLintAtNode
(
$class
,
pht
(
'Class contains %s %s method(s) and must therefore '
.
'be declared `%s`.'
,
phutil_count
(
$abstract_methods
)
,
'abstract'
,
'abstract'
)
)
;
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Mar 24, 03:14 (1 d, 2 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1120415
Default Alt Text
ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule.php (1 KB)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment