Skip to content

Commit 5a533a3

Browse files
committed
Updated Rector to commit c3ff0fd4328b603df30c7e7bb833cb1e641f410c
rectorphp/rector-src@c3ff0fd Upgrade to PHPUnit 10 🥳️ (#3332)
1 parent 84eb4a5 commit 5a533a3

34 files changed

+311
-216
lines changed

config/config.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
use Rector\PSR4\Composer\PSR4NamespaceMatcher;
4646
use Rector\PSR4\Contract\PSR4AutoloadNamespaceMatcherInterface;
4747
use Rector\Utils\Command\MissingInSetCommand;
48-
use RectorPrefix202302\SebastianBergmann\Diff\Differ;
4948
use RectorPrefix202302\Symfony\Component\Console\Application;
5049
use RectorPrefix202302\Symfony\Component\Console\Style\SymfonyStyle;
5150
use function RectorPrefix202302\Symfony\Component\DependencyInjection\Loader\Configurator\service;
@@ -144,6 +143,4 @@
144143
$services->set(\PHPStan\PhpDocParser\Lexer\Lexer::class);
145144
$services->set(TypeParser::class);
146145
$services->set(ConstExprParser::class);
147-
// console color diff
148-
$services->set(Differ::class);
149146
};

e2e/rector-prefixed-rule-test/utils/rector/tests/Rector/RenameSimpleRector/RenameSimpleRectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ public function test(string $filePath): void
2020
/**
2121
* @return Iterator<array<string>>
2222
*/
23-
public function provideData(): Iterator
23+
public static function provideData(): Iterator
2424
{
25-
return $this->yieldFilesFromDirectory(__DIR__ . '/Fixture');
25+
return self::yieldFilesFromDirectory(__DIR__ . '/Fixture');
2626
}
2727

2828
public function provideConfigFilePath(): string

packages/Testing/PHPUnit/AbstractRectorTestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected function tearDown() : void
8080
/**
8181
* @return Iterator<<string>>
8282
*/
83-
protected function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
83+
protected static function yieldFilesFromDirectory(string $directory, string $suffix = '*.php.inc') : Iterator
8484
{
8585
return FixtureFileFinder::yieldDirectory($directory, $suffix);
8686
}
@@ -105,7 +105,7 @@ protected function doTestFile(string $fixtureFilePath) : void
105105
$this->originalTempFilePath = $inputFilePath;
106106
$this->doTestFileMatchesExpectedContent($inputFilePath, $expectedFilePath, $fixtureFilePath);
107107
}
108-
protected function getFixtureTempDirectory() : string
108+
protected static function getFixtureTempDirectory() : string
109109
{
110110
return FixtureTempFileDumper::getTempDirectory();
111111
}

rules/CodingStyle/Rector/ClassMethod/DataProviderArrayItemsNewlinedRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testGetBytesSize(string $content, int $number): void
4141
// ...
4242
}
4343
44-
public function provideData(): array
44+
public static function provideData(): array
4545
{
4646
return [['content', 8], ['content123', 11]];
4747
}
@@ -60,7 +60,7 @@ public function testGetBytesSize(string $content, int $number): void
6060
// ...
6161
}
6262
63-
public function provideData(): array
63+
public static function provideData(): array
6464
{
6565
return [
6666
['content', 8],

rules/TypeDeclaration/Rector/ClassMethod/AddParamTypeBasedOnPHPUnitDataProviderRector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function test($value)
6969
{
7070
}
7171
72-
public function provideData()
72+
public static function provideData()
7373
{
7474
yield ['name'];
7575
}
@@ -87,7 +87,7 @@ public function test(string $value)
8787
{
8888
}
8989
90-
public function provideData()
90+
public static function provideData()
9191
{
9292
yield ['name'];
9393
}

src/Application/VersionResolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '1fd38073d08dff31e7b6f5fecdfc0df8f6e897b0';
22+
public const PACKAGE_VERSION = 'c3ff0fd4328b603df30c7e7bb833cb1e641f410c';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2023-02-02 17:49:56';
27+
public const RELEASE_DATE = '2023-02-03 17:42:57';
2828
/**
2929
* @var int
3030
*/

src/Console/Formatter/ConsoleDiffer.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
namespace Rector\Core\Console\Formatter;
55

66
use RectorPrefix202302\SebastianBergmann\Diff\Differ;
7+
use RectorPrefix202302\SebastianBergmann\Diff\Output\StrictUnifiedDiffOutputBuilder;
8+
use RectorPrefix202302\SebastianBergmann\Diff\Output\UnifiedDiffOutputBuilder;
79
final class ConsoleDiffer
810
{
911
/**
@@ -16,10 +18,13 @@ final class ConsoleDiffer
1618
* @var \Rector\Core\Console\Formatter\ColorConsoleDiffFormatter
1719
*/
1820
private $colorConsoleDiffFormatter;
19-
public function __construct(Differ $differ, \Rector\Core\Console\Formatter\ColorConsoleDiffFormatter $colorConsoleDiffFormatter)
21+
public function __construct(\Rector\Core\Console\Formatter\ColorConsoleDiffFormatter $colorConsoleDiffFormatter)
2022
{
21-
$this->differ = $differ;
2223
$this->colorConsoleDiffFormatter = $colorConsoleDiffFormatter;
24+
// @see https://github.com/sebastianbergmann/diff#strictunifieddiffoutputbuilder
25+
// @see https://github.com/sebastianbergmann/diff/compare/4.0.4...5.0.0#diff-251edf56a6344c03fa264a4926b06c2cee43c25f66192d5f39ebee912b7442dc for upgrade
26+
$unifiedDiffOutputBuilder = new UnifiedDiffOutputBuilder();
27+
$this->differ = new Differ($unifiedDiffOutputBuilder);
2328
}
2429
public function diff(string $old, string $new) : string
2530
{

vendor/autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222

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

25-
return ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7::getLoader();
25+
return ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720::getLoader();

vendor/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,7 @@
20472047
'Rector\\PHPUnit\\PhpDoc\\PhpDocValueToNodeMapper' => $vendorDir . '/rector/rector-phpunit/src/PhpDoc/PhpDocValueToNodeMapper.php',
20482048
'Rector\\PHPUnit\\Rector\\ClassMethod\\AddDoesNotPerformAssertionToNonAssertingTestRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/AddDoesNotPerformAssertionToNonAssertingTestRector.php',
20492049
'Rector\\PHPUnit\\Rector\\ClassMethod\\CreateMockToAnonymousClassRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/CreateMockToAnonymousClassRector.php',
2050+
'Rector\\PHPUnit\\Rector\\ClassMethod\\DataProviderAnnotationToAttributeRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/DataProviderAnnotationToAttributeRector.php',
20502051
'Rector\\PHPUnit\\Rector\\ClassMethod\\DependsAnnotationWithValueToAttributeRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/DependsAnnotationWithValueToAttributeRector.php',
20512052
'Rector\\PHPUnit\\Rector\\ClassMethod\\ExceptionAnnotationRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/ExceptionAnnotationRector.php',
20522053
'Rector\\PHPUnit\\Rector\\ClassMethod\\RemoveEmptyTestMethodRector' => $vendorDir . '/rector/rector-phpunit/src/Rector/ClassMethod/RemoveEmptyTestMethodRector.php',

vendor/composer/autoload_real.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
// autoload_real.php @generated by Composer
44

5-
class ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7
5+
class ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720
66
{
77
private static $loader;
88

@@ -22,17 +22,17 @@ public static function getLoader()
2222
return self::$loader;
2323
}
2424

25-
spl_autoload_register(array('ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7', 'loadClassLoader'), true, true);
25+
spl_autoload_register(array('ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720', 'loadClassLoader'), true, true);
2626
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
27-
spl_autoload_unregister(array('ComposerAutoloaderInita47dd119f87e03c2c15debfad792ecd7', 'loadClassLoader'));
27+
spl_autoload_unregister(array('ComposerAutoloaderInit3f38aa930f66abcbdeb033aa5b78a720', 'loadClassLoader'));
2828

2929
require __DIR__ . '/autoload_static.php';
30-
call_user_func(\Composer\Autoload\ComposerStaticInita47dd119f87e03c2c15debfad792ecd7::getInitializer($loader));
30+
call_user_func(\Composer\Autoload\ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720::getInitializer($loader));
3131

3232
$loader->setClassMapAuthoritative(true);
3333
$loader->register(true);
3434

35-
$filesToLoad = \Composer\Autoload\ComposerStaticInita47dd119f87e03c2c15debfad792ecd7::$files;
35+
$filesToLoad = \Composer\Autoload\ComposerStaticInit3f38aa930f66abcbdeb033aa5b78a720::$files;
3636
$requireFile = static function ($fileIdentifier, $file) {
3737
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
3838
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;

0 commit comments

Comments
 (0)