Skip to content

Commit

Permalink
[CodingStyle] Remove UseMessageVariableForSprintfInSymfonyStyleRector…
Browse files Browse the repository at this point in the history
… as local custom rule (#1419)
  • Loading branch information
TomasVotruba committed Dec 7, 2021
1 parent 16f9dc7 commit 9d8e5c9
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 225 deletions.
26 changes: 2 additions & 24 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 502 Rules Overview
# 501 Rules Overview

<br>

Expand All @@ -10,7 +10,7 @@

- [CodeQuality](#codequality) (70)

- [CodingStyle](#codingstyle) (35)
- [CodingStyle](#codingstyle) (34)

- [Compatibility](#compatibility) (1)

Expand Down Expand Up @@ -2471,28 +2471,6 @@ Use ++ increment instead of `$var += 1`

<br>

### UseMessageVariableForSprintfInSymfonyStyleRector

Decouple `$message` property from `sprintf()` calls in `$this->symfonyStyle->method()`

- class: [`Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector`](../rules/CodingStyle/Rector/MethodCall/UseMessageVariableForSprintfInSymfonyStyleRector.php)

```diff
use Symfony\Component\Console\Style\SymfonyStyle;

final class SomeClass
{
public function run(SymfonyStyle $symfonyStyle)
{
- $symfonyStyle->info(sprintf('Hi %s', 'Tom'));
+ $message = sprintf('Hi %s', 'Tom');
+ $symfonyStyle->info($message);
}
}
```

<br>

### VarConstantCommentRector

Constant should have a `@var` comment with type
Expand Down
2 changes: 0 additions & 2 deletions config/set/code-quality-strict.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

use Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector;
use Rector\CodingStyle\Rector\FuncCall\CountArrayToEmptyArrayComparisonRector;
use Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
$services->set(CountArrayToEmptyArrayComparisonRector::class);
$services->set(UseMessageVariableForSprintfInSymfonyStyleRector::class);
$services->set(FlipTypeControlToUseExclusiveTypeRector::class);
};
11 changes: 0 additions & 11 deletions config/set/coding-style-advanced.php

This file was deleted.

2 changes: 0 additions & 2 deletions config/set/coding-style.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
use Rector\CodingStyle\Rector\FuncCall\VersionCompareFuncCallToConstantRector;
use Rector\CodingStyle\Rector\If_\NullableCompareToNullRector;
use Rector\CodingStyle\Rector\Include_\FollowRequireByDirRector;
use Rector\CodingStyle\Rector\MethodCall\UseMessageVariableForSprintfInSymfonyStyleRector;
use Rector\CodingStyle\Rector\Plus\UseIncrementAssignRector;
use Rector\CodingStyle\Rector\PostInc\PostIncDecToPreIncDecRector;
use Rector\CodingStyle\Rector\Property\AddFalseDefaultToBoolPropertyRector;
Expand Down Expand Up @@ -57,7 +56,6 @@
$services->set(MakeInheritedMethodVisibilitySameAsParentRector::class);
$services->set(CallUserFuncArrayToVariadicRector::class);
$services->set(VersionCompareFuncCallToConstantRector::class);
$services->set(UseMessageVariableForSprintfInSymfonyStyleRector::class);

$services->set(FuncCallToConstFetchRector::class)
->configure([
Expand Down
5 changes: 0 additions & 5 deletions packages/Set/ValueObject/SetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ final class SetList implements SetListInterface
*/
final public const CODING_STYLE = __DIR__ . '/../../../config/set/coding-style.php';

/**
* @var string
*/
final public const CODING_STYLE_ADVANCED = __DIR__ . '/../../../config/set/coding-style-advanced.php';

/**
* @var string
*/
Expand Down
1 change: 0 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

// include sets
$containerConfigurator->import(SetList::CODING_STYLE);
$containerConfigurator->import(SetList::CODING_STYLE_ADVANCED);
$containerConfigurator->import(SetList::CODE_QUALITY);
$containerConfigurator->import(SetList::DEAD_CODE);
$containerConfigurator->import(SetList::PRIVATIZATION);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 9d8e5c9

Please sign in to comment.