Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F22394828
ArcanistPublicPropertyXHPASTLinterRule.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
846 B
Referenced Files
None
Subscribers
None
ArcanistPublicPropertyXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistPublicPropertyXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
130
;
public
function
getLintName
()
{
return
pht
(
'Use of `%s` Properties'
,
'public'
);
}
public
function
getLintSeverity
()
{
return
ArcanistLintSeverity
::
SEVERITY_ADVICE
;
}
public
function
process
(
XHPASTNode
$root
)
{
$members
=
$root
->
selectDescendantsOfType
(
'n_CLASS_MEMBER_DECLARATION_LIST'
);
foreach
(
$members
as
$member
)
{
$modifiers
=
$this
->
getModifiers
(
$member
);
if
(
isset
(
$modifiers
[
'public'
]))
{
$this
->
raiseLintAtNode
(
$member
,
pht
(
'`%s` properties should be avoided. Instead of exposing '
.
'the property value directly, consider using getter '
.
'and setter methods.'
,
'public'
));
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Nov 27, 16:20 (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1223381
Default Alt Text
ArcanistPublicPropertyXHPASTLinterRule.php (846 B)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline