Page MenuHomeWickedGov Phorge

NoDoubleNegativeStandard.xml
No OneTemporary

Size
822 B
Referenced Files
None
Subscribers
None

NoDoubleNegativeStandard.xml

<?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

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)

Event Timeline