format/casts/no-short-bool
In the format-laravel preset. Safe fix.
What it does
Short cast bool using double exclamation mark should not be used.
Why
(bool) binds tighter than instanceof, but ! does not. So !!$a instanceof Foo is true when $a is a Foo, while the rewritten (bool) $a instanceof Foo is always false. Pint rewrites it the same way. Write !!($a instanceof Foo) to keep the check.
Configuration
[format.rules]
"casts/no-short-bool" = true
To skip it in some files, add a @pun-ignore-file comment.
Replaces
no_short_bool_cast(php-cs-fixer)ReplaceMultipleBooleanNot(rector)no-short-bool-cast(mago-linter)