Fork me on GitHub
a Sensio Labs Product

I ate three cookies πŸͺ (v3.40.2) edition

Rule no_short_bool_castΒΆ

Short cast bool using double exclamation mark should not be used.

ExamplesΒΆ

Example #1ΒΆ

--- Original
+++ New
 <?php
-$a = !!$b;
+$a = (bool)$b;

Rule setsΒΆ

The rule is part of the following rule sets:

Source classΒΆ

PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer