Skip to content

Commit 52431ea

Browse files
[Rectify] [Php81] Enable Rectify for Return Never Type only (#1381)
* [Rectify] [Php81] Enable Rectify for Return Never Type only * [ci-review] Rector Rectify * [ci-review] Rector Rectify Co-authored-by: GitHub Action <action@github.com>
1 parent eea8393 commit 52431ea

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

packages/PHPStanStaticTypeMapper/TypeMapper/HasOffsetTypeMapper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Rector\PHPStanStaticTypeMapper\TypeMapper;
66

7-
use PhpParser\Node;
87
use PHPStan\PhpDocParser\Ast\Type\ArrayTypeNode;
98
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
109
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
@@ -38,7 +37,7 @@ public function mapToPHPStanPhpDocTypeNode(Type $type, TypeKind $typeKind): Type
3837
/**
3938
* @param HasOffsetType $type
4039
*/
41-
public function mapToPhpParserNode(Type $type, TypeKind $typeKind): ?Node
40+
public function mapToPhpParserNode(Type $type, TypeKind $typeKind): never
4241
{
4342
throw new ShouldNotHappenException();
4443
}

rector.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Rector\Privatization\Rector\Class_\FinalizeClassesWithoutChildrenRector;
2020
use Rector\Set\ValueObject\LevelSetList;
2121
use Rector\Set\ValueObject\SetList;
22-
use Rector\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector;
2322
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
2423

2524
return static function (ContainerConfigurator $containerConfigurator): void {
@@ -83,8 +82,7 @@
8382
MyCLabsClassToEnumRector::class,
8483
SpatieEnumClassToEnumRector::class,
8584

86-
// temporary skip non finalize public class constant rector
87-
ReturnNeverTypeRector::class,
85+
// temporary skip non return never type rector
8886
MyCLabsMethodCallToEnumConstRector::class,
8987
Php81ResourceReturnToObjectRector::class,
9088

0 commit comments

Comments
 (0)