From 8f5de062fbeb7a7743aa5f4feff94644ac062f60 Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Mon, 30 Dec 2024 17:52:42 +0700 Subject: [PATCH] [CodeQuality] Skip fopen() or die() on LogicalToBooleanRector --- .../Fixture/skip_fopen_or_die_in_assign.php.inc | 13 +++++++++++++ .../Rector/LogicalAnd/LogicalToBooleanRector.php | 8 +++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 rules-tests/CodeQuality/Rector/LogicalAnd/LogicalToBooleanRector/Fixture/skip_fopen_or_die_in_assign.php.inc diff --git a/rules-tests/CodeQuality/Rector/LogicalAnd/LogicalToBooleanRector/Fixture/skip_fopen_or_die_in_assign.php.inc b/rules-tests/CodeQuality/Rector/LogicalAnd/LogicalToBooleanRector/Fixture/skip_fopen_or_die_in_assign.php.inc new file mode 100644 index 00000000000..8d5593def5e --- /dev/null +++ b/rules-tests/CodeQuality/Rector/LogicalAnd/LogicalToBooleanRector/Fixture/skip_fopen_or_die_in_assign.php.inc @@ -0,0 +1,13 @@ +nodeTypeResolver->getType($node->left); + + if (! $type->isBoolean()->yes()) { + return null; + } + return $this->refactorLogicalToBoolean($node); }