Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2894996
ArcanistAbstractPrivateMethodXHPASTLinterRule.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
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
Jan 19 2025, 20:48 (6 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1123648
Default Alt Text
ArcanistAbstractPrivateMethodXHPASTLinterRule.php (1002 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment