mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-27 05:03:31 +00:00
Merge pull request #2935 from rectorphp/fix-double-boolean
Fix double boolean
This commit is contained in:
commit
c221392f35
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user