Merge pull request #2935 from rectorphp/fix-double-boolean

Fix double boolean
This commit is contained in:
Tomas Votruba 2020-02-25 22:09:37 +01:00 committed by GitHub
commit c221392f35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 0 deletions

View File

@ -76,6 +76,10 @@ PHP
return null;
}
if ($this->isTrue($node->if)) {
return null;
}
$ifType = $this->getStaticType($node->if);
if (! $ifType instanceof BooleanType) {
return null;

View File

@ -0,0 +1,11 @@
<?php
namespace Rector\DeadCode\Tests\Rector\Ternary\TernaryToBooleanOrFalseToBooleanAndRector\Fixture;
class SkipDoubleBoolean
{
public function go($values)
{
return is_int($values) ? true : false;
}
}