diff --git a/rules-tests/CodeQuality/Rector/Coalesce/CoalesceToTernaryRector/Fixture/skip_possibly_undefined.php.inc b/rules-tests/CodeQuality/Rector/Coalesce/CoalesceToTernaryRector/Fixture/skip_possibly_undefined.php.inc new file mode 100644 index 00000000000..9ebdb4001bf --- /dev/null +++ b/rules-tests/CodeQuality/Rector/Coalesce/CoalesceToTernaryRector/Fixture/skip_possibly_undefined.php.inc @@ -0,0 +1,15 @@ +left instanceof Variable && ! $scope->hasVariableType((string) $this->getName($node->left))->yes()) { + return null; + } + return new Ternary($node->left, null, $node->right); } }