Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Dec 24, 2024
1 parent 528c506 commit 1e04b28
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Rector\Tests\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector\Fixture;

use Rector\Tests\TypeDeclaration\Rector\BooleanAnd\BinaryOpNullableToInstanceofRector\Source\SomeInstance;

final class SkipAssign2
{
private ?SomeInstance $someClass;

public function run(bool $a)
{
if ($a === true && ($this->someClass = $this->get()) && $this->someClass->someMethod()) {
return $this->someClass->someMethod();
}

return 'no';
}

private function get(): ?SomeInstance
{
return rand(0, 1) ? new SomeInstance() : null;
}
}

0 comments on commit 1e04b28

Please sign in to comment.