Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22419384
ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
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
Sat, Nov 28, 02:20 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1206099
Default Alt Text
ArcanistClassMustBeDeclaredAbstractXHPASTLinterRule.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline