Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F3281464
ArcanistImplodeArgumentOrderXHPASTLinterRule.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
981 B
Referenced Files
None
Subscribers
None
ArcanistImplodeArgumentOrderXHPASTLinterRule.php
View Options
<?php
final
class
ArcanistImplodeArgumentOrderXHPASTLinterRule
extends
ArcanistXHPASTLinterRule
{
const
ID
=
129
;
public
function
getLintName
(
)
{
return
pht
(
'Implode With Glue First'
)
;
}
public
function
getLintSeverity
(
)
{
return
ArcanistLintSeverity
::
SEVERITY_ERROR
;
}
public
function
process
(
XHPASTNode
$root
)
{
$implosions
=
$this
->
getFunctionCalls
(
$root
,
array
(
'implode'
)
)
;
foreach
(
$implosions
as
$implosion
)
{
$parameters
=
$implosion
->
getChildOfType
(
1
,
'n_CALL_PARAMETER_LIST'
)
;
if
(
count
(
$parameters
->
getChildren
(
)
)
!=
2
)
{
continue
;
}
$parameter
=
$parameters
->
getChildByIndex
(
1
)
;
if
(
!
$parameter
->
isStaticScalar
(
)
)
{
continue
;
}
$this
->
raiseLintAtNode
(
$implosion
,
pht
(
'When calling "implode()", pass the "glue" argument first. (The '
.
'other parameter order is deprecated in PHP 7.4 and raises a '
.
'warning.)'
)
)
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Mar 23, 22:31 (1 w, 35 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1139258
Default Alt Text
ArcanistImplodeArgumentOrderXHPASTLinterRule.php (981 B)
Attached To
Mode
rARC Arcanist
Attached
Detach File
Event Timeline
Log In to Comment