Skip to content

Commit 472ca9a

Browse files
committed
Updated Rector to commit df4f9b6ee97a0a30775bba2ca88ff9d6562066b7
rectorphp/rector-src@df4f9b6 [TypeDeclaration] Register NarrowObjectReturnTypeRector to type declaration set (#7615)
1 parent 7c32a80 commit 472ca9a

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

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 = '9ccfc51782ce0b54cb3f21f81af6824e3f785179';
22+
public const PACKAGE_VERSION = 'df4f9b6ee97a0a30775bba2ca88ff9d6562066b7';
2323
/**
2424
* @api
2525
* @var string
2626
*/
27-
public const RELEASE_DATE = '2025-11-06 17:22:19';
27+
public const RELEASE_DATE = '2025-11-09 17:45:20';
2828
/**
2929
* @var int
3030
*/

src/Config/Level/TypeDeclarationLevel.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanConstReturnsRector;
2929
use Rector\TypeDeclaration\Rector\ClassMethod\BoolReturnTypeFromBooleanStrictReturnsRector;
3030
use Rector\TypeDeclaration\Rector\ClassMethod\KnownMagicClassMethodTypeRector;
31+
use Rector\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector;
3132
use Rector\TypeDeclaration\Rector\ClassMethod\NumericReturnTypeFromStrictReturnsRector;
3233
use Rector\TypeDeclaration\Rector\ClassMethod\NumericReturnTypeFromStrictScalarReturnsRector;
3334
use Rector\TypeDeclaration\Rector\ClassMethod\ParamTypeByMethodCallTypeRector;
@@ -118,6 +119,7 @@ final class TypeDeclarationLevel
118119
// param
119120
AddMethodCallBasedStrictParamTypeRector::class,
120121
ParamTypeByParentCallTypeRector::class,
122+
NarrowObjectReturnTypeRector::class,
121123
// multi types (nullable, union)
122124
ReturnUnionTypeRector::class,
123125
// closures

src/DependencyInjection/RectorContainerFactory.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
declare (strict_types=1);
44
namespace Rector\DependencyInjection;
55

6-
use RectorPrefix202511\Illuminate\Container\Container;
6+
use Rector\Config\RectorConfig;
77
use Rector\Autoloading\BootstrapFilesIncluder;
88
use Rector\Caching\Detector\ChangedFilesDetector;
99
use Rector\ValueObject\Bootstrap\BootstrapConfigs;
1010
final class RectorContainerFactory
1111
{
12-
public function createFromBootstrapConfigs(BootstrapConfigs $bootstrapConfigs): Container
12+
public function createFromBootstrapConfigs(BootstrapConfigs $bootstrapConfigs): RectorConfig
1313
{
14-
$container = $this->createFromConfigs($bootstrapConfigs->getConfigFiles());
14+
$rectorConfig = $this->createFromConfigs($bootstrapConfigs->getConfigFiles());
1515
$mainConfigFile = $bootstrapConfigs->getMainConfigFile();
1616
if ($mainConfigFile !== null) {
1717
/** @var ChangedFilesDetector $changedFilesDetector */
18-
$changedFilesDetector = $container->make(ChangedFilesDetector::class);
18+
$changedFilesDetector = $rectorConfig->make(ChangedFilesDetector::class);
1919
$changedFilesDetector->setFirstResolvedConfigFileInfo($mainConfigFile);
2020
}
2121
/** @var BootstrapFilesIncluder $bootstrapFilesIncluder */
22-
$bootstrapFilesIncluder = $container->get(BootstrapFilesIncluder::class);
22+
$bootstrapFilesIncluder = $rectorConfig->get(BootstrapFilesIncluder::class);
2323
$bootstrapFilesIncluder->includeBootstrapFiles();
24-
return $container;
24+
return $rectorConfig;
2525
}
2626
/**
2727
* @param string[] $configFiles
2828
*/
29-
private function createFromConfigs(array $configFiles): Container
29+
private function createFromConfigs(array $configFiles): RectorConfig
3030
{
3131
$lazyContainerFactory = new \Rector\DependencyInjection\LazyContainerFactory();
3232
$rectorConfig = $lazyContainerFactory->create();

src/NodeTypeResolver/NodeTypeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ private function resolveArrayDimFetchType(ArrayDimFetch $arrayDimFetch, Scope $s
368368
}
369369
return $type;
370370
}
371-
private function resolveNativeUnionType(UnionType $unionType): Type
371+
private function resolveNativeUnionType(UnionType $unionType): UnionType
372372
{
373373
$hasChanged = \false;
374374
$types = $unionType->getTypes();

0 commit comments

Comments
 (0)