From 74e284a128952992038cd80f2bedfcc80d8dd8e7 Mon Sep 17 00:00:00 2001 From: Plakhotnikov Vladimir Date: Sun, 30 Jun 2024 12:19:55 +0300 Subject: [PATCH] Add Rector to CI --- rector.php | 6 ++++-- src/Client/Caster/TraceCaster.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/rector.php b/rector.php index ac6a4802..157636c7 100644 --- a/rector.php +++ b/rector.php @@ -6,6 +6,7 @@ use Rector\CodeQuality\Rector\Expression\InlineIfToExplicitIfRector; use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector; use Rector\CodeQuality\Rector\LogicalAnd\LogicalToBooleanRector; +use Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector; use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector; use Rector\Config\RectorConfig; use Rector\Php81\Rector\FuncCall\NullToStrictStringFuncCallArgRector; @@ -25,7 +26,7 @@ __DIR__ . '/phpstan-baseline.neon', ]) ->withImportNames(importNames: true, importDocBlockNames: true, importShortClasses: false, removeUnusedImports: true) - ->withPhpVersion(PhpVersion::PHP_82) + ->withPhpVersion(PhpVersion::PHP_81) ->withPhpSets(php81: true) ->withPreparedSets( deadCode: false, @@ -37,7 +38,7 @@ instanceOf: true, earlyReturn: true, strictBooleans: true, - carbon: true, + carbon: false, rectorPreset: true, )->withSkip([ InlineArrayReturnAssignRector::class, @@ -48,4 +49,5 @@ FlipTypeControlToUseExclusiveTypeRector::class, DisallowedEmptyRuleFixerRector::class, NullToStrictStringFuncCallArgRector::class, + EncapsedStringsToSprintfRector::class, ]); diff --git a/src/Client/Caster/TraceCaster.php b/src/Client/Caster/TraceCaster.php index 871bdc27..377da934 100644 --- a/src/Client/Caster/TraceCaster.php +++ b/src/Client/Caster/TraceCaster.php @@ -55,6 +55,6 @@ private static function renderMethod(array $line): string $line['type'] ??= "::"; - return \sprintf('%s%s%s()', $line['class'], $line['type'], $line['function']); + return "{$line['class']}{$line['type']}{$line['function']}()"; } }