Skip to content

Commit

Permalink
Updated Rector to commit 17d266fecf2392bd90b929948758c31898e959e2
Browse files Browse the repository at this point in the history
rectorphp/rector-src@17d266f [CodeQuality] Skip fopen() or die() on LogicalToBooleanRector on assign (#6635)
  • Loading branch information
TomasVotruba committed Dec 30, 2024
1 parent 376ef50 commit baa2bd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
namespace Rector\CodeQuality\Rector\LogicalAnd;

use PhpParser\Node;
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
use PhpParser\Node\Expr\BinaryOp\BooleanOr;
use PhpParser\Node\Expr\BinaryOp\LogicalAnd;
Expand Down Expand Up @@ -39,10 +40,14 @@ public function getNodeTypes() : array
}
/**
* @param LogicalOr|LogicalAnd $node
* @return \PhpParser\Node\Expr\BinaryOp\BooleanAnd|\PhpParser\Node\Expr\BinaryOp\BooleanOr
* @return \PhpParser\Node\Expr\BinaryOp\BooleanAnd|\PhpParser\Node\Expr\BinaryOp\BooleanOr|null
*/
public function refactor(Node $node)
{
$type = $this->nodeTypeResolver->getNativeType($node->left);
if ($node->left instanceof Assign && !$type->isBoolean()->yes()) {
return null;
}
return $this->refactorLogicalToBoolean($node);
}
/**
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'eb272ee7ab00184569bd327819d69a305e19fdcb';
public const PACKAGE_VERSION = '17d266fecf2392bd90b929948758c31898e959e2';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-12-30 18:17:47';
public const RELEASE_DATE = '2024-12-30 18:19:14';
/**
* @var int
*/
Expand Down

0 comments on commit baa2bd4

Please sign in to comment.