Skip to content

Commit

Permalink
Updated Rector to commit cf1d5b0a492598b893c3fe0ac1ec1d2fcd5018c6
Browse files Browse the repository at this point in the history
rectorphp/rector-src@cf1d5b0 Remove SwapMethodCallArgumentsRector as could lead to infinite swapping, use custom rule with type/value check instead (#4766)
  • Loading branch information
TomasVotruba committed Aug 11, 2023
1 parent 9c230e8 commit 7abf838
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 236 deletions.
47 changes: 2 additions & 45 deletions docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# 356 Rules Overview
# 355 Rules Overview

<br>

## Categories

- [Arguments](#arguments) (6)
- [Arguments](#arguments) (5)

- [CodeQuality](#codequality) (70)

Expand Down Expand Up @@ -254,49 +254,6 @@ return static function (RectorConfig $rectorConfig): void {

<br>

### SwapMethodCallArgumentsRector

Reorder arguments in method calls

:wrench: **configure it!**

- class: [`Rector\Arguments\Rector\MethodCall\SwapMethodCallArgumentsRector`](../rules/Arguments/Rector/MethodCall/SwapMethodCallArgumentsRector.php)

```php
<?php

declare(strict_types=1);

use Rector\Arguments\Rector\MethodCall\SwapMethodCallArgumentsRector;
use Rector\Arguments\ValueObject\SwapMethodCallArguments;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->ruleWithConfiguration(SwapMethodCallArgumentsRector::class, [
new SwapMethodCallArguments('Caller', 'call', [
2,
1,
0,
]),
]);
};
```


```diff
final class SomeClass
{
public function run(Caller $caller)
{
- return $caller->call('one', 'two', 'three');
+ return $caller->call('three', 'two', 'one');
}
}
```

<br>

## CodeQuality

### AbsolutizeRequireAndIncludePathRector
Expand Down
125 changes: 0 additions & 125 deletions rules/Arguments/Rector/MethodCall/SwapMethodCallArgumentsRector.php

This file was deleted.

50 changes: 0 additions & 50 deletions rules/Arguments/ValueObject/SwapMethodCallArguments.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '575c8d86349fae3144987da1ee705495b31335e7';
public const PACKAGE_VERSION = 'cf1d5b0a492598b893c3fe0ac1ec1d2fcd5018c6';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2023-08-11 09:32:07';
public const RELEASE_DATE = '2023-08-11 11:10:32';
/**
* @var int
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit40acdc2d042f21bbee32f3edf8d89ae1::getLoader();
return ComposerAutoloaderInit16be4751e7661197313674642b820328::getLoader();
2 changes: 0 additions & 2 deletions vendor/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -1260,13 +1260,11 @@
'Rector\\Arguments\\Rector\\FuncCall\\FunctionArgumentDefaultValueReplacerRector' => $baseDir . '/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php',
'Rector\\Arguments\\Rector\\FuncCall\\SwapFuncCallArgumentsRector' => $baseDir . '/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php',
'Rector\\Arguments\\Rector\\MethodCall\\RemoveMethodCallParamRector' => $baseDir . '/rules/Arguments/Rector/MethodCall/RemoveMethodCallParamRector.php',
'Rector\\Arguments\\Rector\\MethodCall\\SwapMethodCallArgumentsRector' => $baseDir . '/rules/Arguments/Rector/MethodCall/SwapMethodCallArgumentsRector.php',
'Rector\\Arguments\\ValueObject\\ArgumentAdder' => $baseDir . '/rules/Arguments/ValueObject/ArgumentAdder.php',
'Rector\\Arguments\\ValueObject\\RemoveMethodCallParam' => $baseDir . '/rules/Arguments/ValueObject/RemoveMethodCallParam.php',
'Rector\\Arguments\\ValueObject\\ReplaceArgumentDefaultValue' => $baseDir . '/rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php',
'Rector\\Arguments\\ValueObject\\ReplaceFuncCallArgumentDefaultValue' => $baseDir . '/rules/Arguments/ValueObject/ReplaceFuncCallArgumentDefaultValue.php',
'Rector\\Arguments\\ValueObject\\SwapFuncCallArguments' => $baseDir . '/rules/Arguments/ValueObject/SwapFuncCallArguments.php',
'Rector\\Arguments\\ValueObject\\SwapMethodCallArguments' => $baseDir . '/rules/Arguments/ValueObject/SwapMethodCallArguments.php',
'Rector\\BetterPhpDocParser\\Annotation\\AnnotationNaming' => $baseDir . '/packages/BetterPhpDocParser/Annotation/AnnotationNaming.php',
'Rector\\BetterPhpDocParser\\Attributes\\AttributeMirrorer' => $baseDir . '/packages/BetterPhpDocParser/Attributes/AttributeMirrorer.php',
'Rector\\BetterPhpDocParser\\Comment\\CommentsMerger' => $baseDir . '/packages/BetterPhpDocParser/Comment/CommentsMerger.php',
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInit40acdc2d042f21bbee32f3edf8d89ae1
class ComposerAutoloaderInit16be4751e7661197313674642b820328
{
private static $loader;

Expand All @@ -22,17 +22,17 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInit40acdc2d042f21bbee32f3edf8d89ae1', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit16be4751e7661197313674642b820328', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
spl_autoload_unregister(array('ComposerAutoloaderInit40acdc2d042f21bbee32f3edf8d89ae1', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit16be4751e7661197313674642b820328', 'loadClassLoader'));

require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit16be4751e7661197313674642b820328::getInitializer($loader));

$loader->setClassMapAuthoritative(true);
$loader->register(true);

$filesToLoad = \Composer\Autoload\ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1::$files;
$filesToLoad = \Composer\Autoload\ComposerStaticInit16be4751e7661197313674642b820328::$files;
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
Expand Down
10 changes: 4 additions & 6 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Composer\Autoload;

class ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1
class ComposerStaticInit16be4751e7661197313674642b820328
{
public static $files = array (
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
Expand Down Expand Up @@ -1513,13 +1513,11 @@ class ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1
'Rector\\Arguments\\Rector\\FuncCall\\FunctionArgumentDefaultValueReplacerRector' => __DIR__ . '/../..' . '/rules/Arguments/Rector/FuncCall/FunctionArgumentDefaultValueReplacerRector.php',
'Rector\\Arguments\\Rector\\FuncCall\\SwapFuncCallArgumentsRector' => __DIR__ . '/../..' . '/rules/Arguments/Rector/FuncCall/SwapFuncCallArgumentsRector.php',
'Rector\\Arguments\\Rector\\MethodCall\\RemoveMethodCallParamRector' => __DIR__ . '/../..' . '/rules/Arguments/Rector/MethodCall/RemoveMethodCallParamRector.php',
'Rector\\Arguments\\Rector\\MethodCall\\SwapMethodCallArgumentsRector' => __DIR__ . '/../..' . '/rules/Arguments/Rector/MethodCall/SwapMethodCallArgumentsRector.php',
'Rector\\Arguments\\ValueObject\\ArgumentAdder' => __DIR__ . '/../..' . '/rules/Arguments/ValueObject/ArgumentAdder.php',
'Rector\\Arguments\\ValueObject\\RemoveMethodCallParam' => __DIR__ . '/../..' . '/rules/Arguments/ValueObject/RemoveMethodCallParam.php',
'Rector\\Arguments\\ValueObject\\ReplaceArgumentDefaultValue' => __DIR__ . '/../..' . '/rules/Arguments/ValueObject/ReplaceArgumentDefaultValue.php',
'Rector\\Arguments\\ValueObject\\ReplaceFuncCallArgumentDefaultValue' => __DIR__ . '/../..' . '/rules/Arguments/ValueObject/ReplaceFuncCallArgumentDefaultValue.php',
'Rector\\Arguments\\ValueObject\\SwapFuncCallArguments' => __DIR__ . '/../..' . '/rules/Arguments/ValueObject/SwapFuncCallArguments.php',
'Rector\\Arguments\\ValueObject\\SwapMethodCallArguments' => __DIR__ . '/../..' . '/rules/Arguments/ValueObject/SwapMethodCallArguments.php',
'Rector\\BetterPhpDocParser\\Annotation\\AnnotationNaming' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/Annotation/AnnotationNaming.php',
'Rector\\BetterPhpDocParser\\Attributes\\AttributeMirrorer' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/Attributes/AttributeMirrorer.php',
'Rector\\BetterPhpDocParser\\Comment\\CommentsMerger' => __DIR__ . '/../..' . '/packages/BetterPhpDocParser/Comment/CommentsMerger.php',
Expand Down Expand Up @@ -2982,9 +2980,9 @@ class ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit40acdc2d042f21bbee32f3edf8d89ae1::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit16be4751e7661197313674642b820328::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit16be4751e7661197313674642b820328::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit16be4751e7661197313674642b820328::$classMap;

}, null, ClassLoader::class);
}
Expand Down

0 comments on commit 7abf838

Please sign in to comment.