Skip to content

Commit 2449ce3

Browse files
committed
Updated Rector to commit c4b68d5fd646875fa96f68941e4b2b643a06d1f8
rectorphp/rector-src@c4b68d5 [Php70] Handle class named Pool on Php4ConstructorRector (#6887)
1 parent 4f3157a commit 2449ce3

24 files changed

Lines changed: 375 additions & 180 deletions

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1866,12 +1866,12 @@
18661866
"source": {
18671867
"type": "git",
18681868
"url": "https:\/\/github.com\/rectorphp\/rector-symfony.git",
1869-
"reference": "3234dd8a2a60c0deb6e232a7c820b20a8e7a4726"
1869+
"reference": "6de3184408c71b24c5efb47867dc2d0bbf759ae9"
18701870
},
18711871
"dist": {
18721872
"type": "zip",
1873-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/3234dd8a2a60c0deb6e232a7c820b20a8e7a4726",
1874-
"reference": "3234dd8a2a60c0deb6e232a7c820b20a8e7a4726",
1873+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-symfony\/zipball\/6de3184408c71b24c5efb47867dc2d0bbf759ae9",
1874+
"reference": "6de3184408c71b24c5efb47867dc2d0bbf759ae9",
18751875
"shasum": ""
18761876
},
18771877
"require": {
@@ -1900,7 +1900,7 @@
19001900
"tomasvotruba\/unused-public": "^2.0",
19011901
"tracy\/tracy": "^2.10"
19021902
},
1903-
"time": "2025-05-07T12:42:13+00:00",
1903+
"time": "2025-05-07T14:45:39+00:00",
19041904
"default-branch": true,
19051905
"type": "rector-extension",
19061906
"extra": {

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/rector/extension-installer/src/GeneratedConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
final class GeneratedConfig
1111
{
12-
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 826f808'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 2b141c8'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 96b3565'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 3234dd8'));
12+
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 826f808'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 2b141c8'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 96b3565'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 6de3184'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-symfony/config/sets/symfony/symfony6/symfony-return-types.php

Lines changed: 0 additions & 171 deletions
This file was deleted.

vendor/rector/rector-symfony/config/sets/symfony/symfony6/symfony60.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,21 @@
77
# https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.0.md
88
return static function (RectorConfig $rectorConfig) : void {
99
// $rectorConfig->sets([SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES]);
10-
$rectorConfig->import(__DIR__ . '/symfony-return-types.php');
11-
// todo: extract this as well
10+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-serializer.php');
11+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-security-http.php');
12+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-console.php');
13+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-browser-kit.php');
14+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-http-kernel.php');
15+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-validator.php');
16+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-form.php');
17+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-translation.php');
18+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-property-access.php');
19+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-property-info.php');
20+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-routing.php');
21+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-templating.php');
22+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-event-dispatcher.php');
23+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-expression-language.php');
24+
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-options-resolver.php');
1225
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-dependency-injection.php');
1326
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-contracts.php');
1427
$rectorConfig->import(__DIR__ . '/symfony60/symfony60-config.php');
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare (strict_types=1);
4+
namespace RectorPrefix202505;
5+
6+
use PHPStan\Type\ObjectType;
7+
use PHPStan\Type\ObjectWithoutClassType;
8+
use Rector\Config\RectorConfig;
9+
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
10+
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
11+
// https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.0.md
12+
// @see https://github.com/symfony/symfony/blob/6.1/.github/expected-missing-return-types.diff
13+
return static function (RectorConfig $rectorConfig) : void {
14+
$browserKitResponseType = new ObjectType('Symfony\\Component\\BrowserKit\\Response');
15+
$rectorConfig->ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [new AddReturnTypeDeclaration('Symfony\\Component\\BrowserKit\\AbstractBrowser', 'doRequestInProcess', new ObjectWithoutClassType()), new AddReturnTypeDeclaration('Symfony\\Component\\BrowserKit\\AbstractBrowser', 'doRequest', new ObjectWithoutClassType()), new AddReturnTypeDeclaration('Symfony\\Component\\BrowserKit\\AbstractBrowser', 'filterRequest', new ObjectWithoutClassType()), new AddReturnTypeDeclaration('Symfony\\Component\\BrowserKit\\AbstractBrowser', 'filterResponse', $browserKitResponseType)]);
16+
};

vendor/rector/rector-symfony/config/sets/symfony/symfony6/symfony60/symfony60-config.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@
66
use PHPStan\Type\MixedType;
77
use Rector\Config\RectorConfig;
88
use Rector\TypeDeclaration\Rector\ClassMethod\AddParamTypeDeclarationRector;
9+
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
910
use Rector\TypeDeclaration\ValueObject\AddParamTypeDeclaration;
11+
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
12+
use PHPStan\Type\BooleanType;
13+
use PHPStan\Type\ObjectType;
14+
use PHPStan\Type\StringType;
15+
use PHPStan\Type\UnionType;
16+
use PHPStan\Type\ArrayType;
1017
return static function (RectorConfig $rectorConfig) : void {
1118
$rectorConfig->ruleWithConfiguration(AddParamTypeDeclarationRector::class, [new AddParamTypeDeclaration('Symfony\\Component\\Config\\Loader\\LoaderInterface', 'load', 0, new MixedType(\true)), new AddParamTypeDeclaration('Symfony\\Component\\Config\\Loader\\LoaderInterface', 'supports', 0, new MixedType(\true))]);
19+
$arrayType = new ArrayType(new MixedType(), new MixedType());
20+
$rectorConfig->ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Loader\\LoaderInterface', 'load', new MixedType()), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Loader\\Loader', 'import', new MixedType()), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Definition\\ConfigurationInterface', 'getConfigTreeBuilder', new ObjectType('Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder')), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\FileLocator', 'locate', new UnionType([new StringType(), $arrayType])), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\FileLocatorInterface', 'locate', new UnionType([new StringType(), $arrayType])), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Loader\\FileLoader', 'import', new MixedType()), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Loader\\Loader', 'import', new MixedType()), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Loader\\LoaderInterface', 'load', new MixedType()), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Loader\\LoaderInterface', 'supports', new BooleanType()), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\Loader\\LoaderInterface', 'getResolver', new ObjectType('Symfony\\Component\\Config\\Loader\\LoaderResolverInterface')), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\ResourceCheckerInterface', 'supports', new BooleanType()), new AddReturnTypeDeclaration('Symfony\\Component\\Config\\ResourceCheckerInterface', 'isFresh', new BooleanType())]);
1221
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
3+
declare (strict_types=1);
4+
namespace RectorPrefix202505;
5+
6+
use PHPStan\Type\ArrayType;
7+
use PHPStan\Type\BooleanType;
8+
use PHPStan\Type\IntegerType;
9+
use PHPStan\Type\MixedType;
10+
use PHPStan\Type\NullType;
11+
use PHPStan\Type\ObjectType;
12+
use PHPStan\Type\StringType;
13+
use PHPStan\Type\UnionType;
14+
use Rector\Config\RectorConfig;
15+
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
16+
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
17+
// https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.0.md
18+
// @see https://github.com/symfony/symfony/blob/6.1/.github/expected-missing-return-types.diff
19+
return static function (RectorConfig $rectorConfig) : void {
20+
$arrayType = new ArrayType(new MixedType(), new MixedType());
21+
$commandType = new ObjectType('Symfony\\Component\\Console\\Command\\Command');
22+
$rectorConfig->ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [
23+
// @see https://github.com/symfony/symfony/pull/43028/files
24+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Helper\\HelperInterface', 'getName', new StringType()),
25+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Application', 'doRun', new IntegerType()),
26+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Application', 'getLongVersion', new StringType()),
27+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Application', 'add', new UnionType([new NullType(), $commandType])),
28+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Application', 'get', $commandType),
29+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Application', 'find', $commandType),
30+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Application', 'all', $arrayType),
31+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Application', 'doRunCommand', new IntegerType()),
32+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Command\\Command', 'isEnabled', new BooleanType()),
33+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Command\\Command', 'execute', new IntegerType()),
34+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Helper\\HelperInterface', 'getName', new StringType()),
35+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Input\\InputInterface', 'getParameterOption', new MixedType()),
36+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Input\\InputInterface', 'getArgument', new MixedType()),
37+
new AddReturnTypeDeclaration('Symfony\\Component\\Console\\Input\\InputInterface', 'getOption', new MixedType()),
38+
]);
39+
};

vendor/rector/rector-symfony/config/sets/symfony/symfony6/symfony60/symfony60-dependency-injection.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,23 @@
77
use Rector\Config\RectorConfig;
88
use Rector\Symfony\Symfony60\Rector\FuncCall\ReplaceServiceArgumentRector;
99
use Rector\Symfony\ValueObject\ReplaceServiceArgument;
10+
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
11+
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
12+
use PHPStan\Type\Constant\ConstantBooleanType;
13+
use PHPStan\Type\MixedType;
14+
use PHPStan\Type\NullType;
15+
use PHPStan\Type\ObjectType;
16+
use PHPStan\Type\ObjectWithoutClassType;
17+
use PHPStan\Type\StringType;
18+
use PHPStan\Type\UnionType;
19+
use PHPStan\Type\ArrayType;
20+
use PHPStan\Type\BooleanType;
21+
use PHPStan\Type\FloatType;
22+
use PHPStan\Type\IntegerType;
1023
return static function (RectorConfig $rectorConfig) : void {
1124
$rectorConfig->ruleWithConfiguration(ReplaceServiceArgumentRector::class, [new ReplaceServiceArgument('Psr\\Container\\ContainerInterface', new String_('service_container')), new ReplaceServiceArgument('Symfony\\Component\\DependencyInjection\\ContainerInterface', new String_('service_container'))]);
25+
$configurationType = new ObjectType('Symfony\\Component\\Config\\Definition\\ConfigurationInterface');
26+
$arrayType = new ArrayType(new MixedType(), new MixedType());
27+
$scalarTypes = [$arrayType, new BooleanType(), new StringType(), new IntegerType(), new FloatType(), new NullType()];
28+
$rectorConfig->ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Compiler\\AbstractRecursivePass', 'processValue', new MixedType()), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Extension\\ConfigurationExtensionInterface', 'getConfiguration', new UnionType([new NullType(), $configurationType])), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Extension\\Extension', 'getXsdValidationBasePath', new UnionType([new StringType(), new ConstantBooleanType(\false)])), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Extension\\Extension', 'getNamespace', new StringType()), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Extension\\Extension', 'getConfiguration', new UnionType([new NullType(), $configurationType])), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface', 'getNamespace', new StringType()), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface', 'getXsdValidationBasePath', new UnionType([new StringType(), new ConstantBooleanType(\false)])), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Extension\\ExtensionInterface', 'getAlias', new StringType()), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\LazyProxy\\Instantiator\\InstantiatorInterface', 'instantiateProxy', new ObjectWithoutClassType()), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\Container', 'getParameter', new UnionType($scalarTypes)), new AddReturnTypeDeclaration('Symfony\\Component\\DependencyInjection\\ContainerInterface', 'getParameter', new UnionType($scalarTypes))]);
1229
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
declare (strict_types=1);
4+
namespace RectorPrefix202505;
5+
6+
use PHPStan\Type\ArrayType;
7+
use PHPStan\Type\MixedType;
8+
use Rector\Config\RectorConfig;
9+
use Rector\TypeDeclaration\Rector\ClassMethod\AddReturnTypeDeclarationRector;
10+
use Rector\TypeDeclaration\ValueObject\AddReturnTypeDeclaration;
11+
// https://github.com/symfony/symfony/blob/6.1/UPGRADE-6.0.md
12+
// @see https://github.com/symfony/symfony/blob/6.1/.github/expected-missing-return-types.diff
13+
return static function (RectorConfig $rectorConfig) : void {
14+
$arrayType = new ArrayType(new MixedType(), new MixedType());
15+
$rectorConfig->ruleWithConfiguration(AddReturnTypeDeclarationRector::class, [new AddReturnTypeDeclaration('Symfony\\Component\\EventDispatcher\\EventSubscriberInterface', 'getSubscribedEvents', $arrayType)]);
16+
};

0 commit comments

Comments
 (0)