Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7465305
NoDoubleNegativeStandard.xml
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
822 B
Referenced Files
None
Subscribers
None
NoDoubleNegativeStandard.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=
"No Double Negative"
>
<standard>
<![CDATA[
Detects double negation in code, which is effectively the same as a boolean cast, but with a much higher cognitive load.
]]>
</standard>
<code_comparison>
<code
title=
"Valid: using singular negation or a boolean cast."
>
<![CDATA[
$
var =
$
a && <em>!</em>
$
b;
if(<em>(bool)</em> callMe(
$
a)) {}
]]>
</code>
<code
title=
"Invalid: using double negation (or more)."
>
<![CDATA[
$
var =
$
a && <em>! !</em>
$
b;
if(<em>! ! !</em> callMe(
$
a)) {}
]]>
</code>
</code_comparison>
</documentation>
File Metadata
Details
Attached
Mime Type
text/xml
Expires
Mon, Nov 23, 05:01 (3 d, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
70/d2/90db288ea892c9057fa0009f3f20
Default Alt Text
NoDoubleNegativeStandard.xml (822 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment