Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1430536
CommaAfterLastStandard.xml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
CommaAfterLastStandard.xml
View Options
<?xml version="1.0"?>
<documentation
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
title=
"Comma After Last Array Item"
>
<standard>
<![CDATA[
For single-line arrays, there should be <em>no</em> comma after the last array item.
However, for multi-line arrays, there <em>should</em> be a comma after the last array item.
]]>
</standard>
<code_comparison>
<code
title=
"Valid: Single-line array without a comma after the last item"
>
<![CDATA[
$
args = array(1, 2, 3);
]]>
</code>
<code
title=
"Invalid: Single-line array with a comma after the last item"
>
<![CDATA[
$
args = array(1, 2, 3<em>,</em> );
]]>
</code>
</code_comparison>
<code_comparison>
<code
title=
"Valid: Multi-line array with a comma after the last item"
>
<![CDATA[
$
args = [
1 => 'foo',
2 => 'bar'<em>,</em>
];
]]>
</code>
<code
title=
"Invalid: Multi-line array without a comma after the last item"
>
<![CDATA[
$
args = [
1 => 'foo',
2 => 'bar'
];
]]>
</code>
</code_comparison>
</documentation>
File Metadata
Details
Attached
Mime Type
text/xml
Expires
Sat, May 16, 19:07 (5 h, 29 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
e5/bf/184362f69d959ca484333ec90c52
Default Alt Text
CommaAfterLastStandard.xml (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment