Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22395912
ArcanistAbstractPrivateMethodXHPASTLinterRule.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
1002 B
Referenced Files
None
Subscribers
None
ArcanistAbstractPrivateMethodXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistAbstractPrivateMethodXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
107
;
public
function
getLintName
()
{
return
pht
(
'`%s` Method Cannot Be Declared `%s`'
,
'abstract'
,
'private'
);
}
public
function
process
(
XHPASTNode
$root
)
{
$methods
=
$root
->
selectDescendantsOfType
(
'n_METHOD_DECLARATION'
);
foreach
(
$methods
as
$method
)
{
$method_modifiers
=
$method
->
getChildOfType
(
0
,
'n_METHOD_MODIFIER_LIST'
)
->
selectDescendantsOfType
(
'n_STRING'
);
$modifiers
=
array
();
foreach
(
$method_modifiers
as
$modifier
)
{
$modifiers
[
strtolower
(
$modifier
->
getConcreteString
())]
=
true
;
}
if
(
idx
(
$modifiers
,
'abstract'
)
&&
idx
(
$modifiers
,
'private'
))
{
$this
->
raiseLintAtNode
(
$method
,
pht
(
'`%s` method cannot be declared `%s`. '
.
'This construct will cause a fatal error.'
,
'abstract'
,
'private'
));
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 16:30 (1 d, 21 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1208803
Default Alt Text
ArcanistAbstractPrivateMethodXHPASTLinterRule.php (1002 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline