From 592a0c488571d1e2bb495c11e9a6d07aa41968b1 Mon Sep 17 00:00:00 2001 From: guanguans Date: Fri, 16 Aug 2024 16:40:12 +0800 Subject: [PATCH] ci(rector): add new rules for Rector configuration - Added BooleanInBooleanNotRuleFixerRector to the rules. - Added StaticClosureRector to the rules. These changes enhance the Rector configuration by incorporating additional rules that improve code quality and maintainability. --- rector.php | 2 ++ src/Support/helpers.php | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rector.php b/rector.php index 81ea966..08ef5b7 100644 --- a/rector.php +++ b/rector.php @@ -172,7 +172,9 @@ ]); $rectorConfig->rules([ + BooleanInBooleanNotRuleFixerRector::class, InlineConstructorDefaultToPropertyRector::class, + StaticClosureRector::class, ]); $rectorConfig->ruleWithConfiguration(RenameFunctionRector::class, [ diff --git a/src/Support/helpers.php b/src/Support/helpers.php index 010b4b8..4aadcf9 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -14,11 +14,9 @@ /** * @param mixed $expression * - * @return string|void - * * @noinspection DebugFunctionUsageInspection */ - function var_output($expression, bool $return = false) + function var_output($expression, bool $return = false): ?string { $patterns = [ "/array \\(\n\\)/" => '[]', @@ -36,6 +34,8 @@ function var_output($expression, bool $return = false) } echo $export; + + return null; } }