Skip to content

Commit

Permalink
[cs] [cs] [SOLID] Change if && to early return
Browse files Browse the repository at this point in the history
  • Loading branch information
rector-bot committed Oct 9, 2020
1 parent c73a0e7 commit df95a6a
Showing 1 changed file with 34 additions and 24 deletions.
58 changes: 34 additions & 24 deletions docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,12 +236,8 @@ return static function (ContainerConfigurator $containerConfigurator): void {

$services->set(MoveValueObjectsToValueObjectDirectoryRector::class)
->call('configure', [[
MoveValueObjectsToValueObjectDirectoryRector::TYPES => [
'ValueObjectInterfaceClassName',
],
MoveValueObjectsToValueObjectDirectoryRector::SUFFIXES => [
'Search',
],
MoveValueObjectsToValueObjectDirectoryRector::TYPES => ['ValueObjectInterfaceClassName'],
MoveValueObjectsToValueObjectDirectoryRector::SUFFIXES => ['Search'],
MoveValueObjectsToValueObjectDirectoryRector::ENABLE_VALUE_OBJECT_GUESSING => true,
]]);
};
Expand Down Expand Up @@ -310,10 +306,12 @@ return static function (ContainerConfigurator $containerConfigurator): void {

$services->set(ArrayToFluentCallRector::class)
->call('configure', [[
ArrayToFluentCallRector::ARRAYS_TO_FLUENT_CALLS => inline_value_objects([new ArrayToFluentCall('ArticlesTable', [
'foreignKey' => 'setForeignKey',
'propertyName' => 'setProperty',
])]),
ArrayToFluentCallRector::ARRAYS_TO_FLUENT_CALLS => inline_value_objects(
[new ArrayToFluentCall('ArticlesTable', [
'foreignKey' => 'setForeignKey',
'propertyName' => 'setProperty',
])]
),
]]);
};
```
Expand Down Expand Up @@ -454,12 +452,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
'paging',
'getAttribute',
'ServerRequest'
), new RenameMethodCallBasedOnParameter(
'withParam',
'paging',
'withAttribute',
'ServerRequest'
)]
), new RenameMethodCallBasedOnParameter('withParam', 'paging', 'withAttribute', 'ServerRequest')]
),
]]);
};
Expand Down Expand Up @@ -5709,7 +5702,15 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$services->set(ArgumentDefaultValueReplacerRector::class)
->call('configure', [[
ArgumentDefaultValueReplacerRector::REPLACED_ARGUMENTS => inline_value_objects(
[new ArgumentDefaultValueReplacer('SomeExampleClass', 'someMethod', 0, 'SomeClass::OLD_CONSTANT', 'false')]
[
new ArgumentDefaultValueReplacer(
'SomeExampleClass',
'someMethod',
0,
'SomeClass::OLD_CONSTANT',
'false'
),
]
),
]]);
};
Expand Down Expand Up @@ -7002,10 +7003,7 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$services->set(AddTopIncludeRector::class)
->call('configure', [[
AddTopIncludeRector::AUTOLOAD_FILE_PATH => '/../autoloader.php',
AddTopIncludeRector::PATTERNS => [
'pat*/*/?ame.php',
'somepath/?ame.php',
],
AddTopIncludeRector::PATTERNS => ['pat*/*/?ame.php', 'somepath/?ame.php'],
]]);
};
```
Expand Down Expand Up @@ -9547,7 +9545,14 @@ return static function (ContainerConfigurator $containerConfigurator): void {
$services->set(ArrayArgumentInTestToDataProviderRector::class)
->call('configure', [[
ArrayArgumentInTestToDataProviderRector::ARRAY_ARGUMENTS_TO_DATA_PROVIDERS => inline_value_objects(
[new ArrayArgumentToDataProvider('PHPUnit\Framework\TestCase', 'doTestMultiple', 'doTestSingle', 'number')]
[
new ArrayArgumentToDataProvider(
'PHPUnit\Framework\TestCase',
'doTestMultiple',
'doTestSingle',
'number'
),
]
),
]]);
};
Expand Down Expand Up @@ -14832,7 +14837,10 @@ return static function (ContainerConfigurator $containerConfigurator): void {

$services->set(GetToConstructorInjectionRector::class)
->call('configure', [[
GetToConstructorInjectionRector::GET_METHOD_AWARE_TYPES => ['SymfonyControllerClassName', 'GetTraitClassName'],
GetToConstructorInjectionRector::GET_METHOD_AWARE_TYPES => [
'SymfonyControllerClassName',
'GetTraitClassName',
],
]]);
};
```
Expand Down Expand Up @@ -15621,7 +15629,9 @@ return static function (ContainerConfigurator $containerConfigurator): void {

$services->set(NewToStaticCallRector::class)
->call('configure', [[
NewToStaticCallRector::TYPE_TO_STATIC_CALLS => inline_value_objects([new NewToStaticCall('Cookie', 'Cookie', 'create')]),
NewToStaticCallRector::TYPE_TO_STATIC_CALLS => inline_value_objects(
[new NewToStaticCall('Cookie', 'Cookie', 'create')]
),
]]);
};
```
Expand Down

0 comments on commit df95a6a

Please sign in to comment.