Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F7862231
ArcanistDefaultParametersXHPASTLinterRule.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
ArcanistDefaultParametersXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistDefaultParametersXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
60
;
public
function
getLintName
()
{
return
pht
(
'Default Parameters'
);
}
public
function
getLintSeverity
()
{
return
ArcanistLintSeverity
::
SEVERITY_WARNING
;
}
public
function
process
(
XHPASTNode
$root
)
{
$parameter_lists
=
$root
->
selectDescendantsOfType
(
'n_DECLARATION_PARAMETER_LIST'
);
foreach
(
$parameter_lists
as
$parameter_list
)
{
$default_found
=
false
;
$parameters
=
$parameter_list
->
selectDescendantsOfType
(
'n_DECLARATION_PARAMETER'
);
foreach
(
$parameters
as
$parameter
)
{
$default_value
=
$parameter
->
getChildByIndex
(
2
);
if
(
$default_value
->
getTypeName
()
!=
'n_EMPTY'
)
{
$default_found
=
true
;
}
else
if
(
$default_found
)
{
$this
->
raiseLintAtNode
(
$parameter_list
,
pht
(
'Arguments with default values must be at the end '
.
'of the argument list.'
));
}
}
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Aug 13, 20:16 (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
872188
Default Alt Text
ArcanistDefaultParametersXHPASTLinterRule.php (1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment