Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7484716
DisallowShortTernaryStandard.xml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
908 B
Referenced Files
None
Subscribers
None
DisallowShortTernaryStandard.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=
"Disallow Short Ternary"
>
<standard>
<![CDATA[
Using short ternaries is not allowed.
While short ternaries are useful when used correctly, the principle of them is often misunderstood and they are more often than not used incorrectly, leading to hard to debug issues and/or PHP warnings/notices.
]]>
</standard>
<code_comparison>
<code
title=
"Valid: Full ternary."
>
<![CDATA[
echo !empty(
$
a) <em>?</em>
$
a <em>:</em> 'default';
]]>
</code>
<code
title=
"Invalid: Short ternary."
>
<![CDATA[
echo !empty(
$
a) <em>?:</em> 'default';
echo
$
a <em>? :</em> 'default';
]]>
</code>
</code_comparison>
</documentation>
File Metadata
Details
Attached
Mime Type
text/xml
Expires
Mon, Nov 23, 14:18 (1 w, 10 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
00/7d/a81da851241c7d48560ea0d8d1e0
Default Alt Text
DisallowShortTernaryStandard.xml (908 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment