HumHub Documentation (unofficial)

RequireExplicitBooleanOperatorPrecedenceSniff.php

Forbid mixing different binary boolean operators within a single expression without making precedence clear using parentheses.

$one = false; $two = false; $three = true;

$result = $one && $two || $three; $result3 = $one && !$two xor $three;

Sister-sniff to the Squiz.ControlStructures.InlineIfDeclaration and Squiz.Formatting.OperatorBracket.MissingBrackets sniffs.

Tags
author

Tim Duesterhus duesterhus@woltlab.com

copyright

2021-2023 WoltLab GmbH.

copyright

2024 PHPCSStandards and contributors

license

https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence

Table of Contents

Classes

RequireExplicitBooleanOperatorPrecedenceSniff

        
On this page

Search results