Skip to content

Commit 1765474

Browse files
committed
[fix] avoid changing generic interface in NarrowObjectReturnTypeRector, focus on objects as in definition
1 parent 8cd3cc6 commit 1765474

File tree

9 files changed

+37
-257
lines changed

9 files changed

+37
-257
lines changed

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/also_update_generic_collection_docblock.php.inc

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

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/do_not_change_valid_generic_collection_docblock.php.inc

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

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/narrow_from_interface.php.inc

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

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/narrow_interface_inheritance.php.inc

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

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/narrow_interface_via_method_call.php.inc

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Fixture;
4+
5+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\TalkInterface;
6+
use Rector\Tests\TypeDeclaration\Rector\ClassMethod\NarrowObjectReturnTypeRector\Source\ConferenceTalkImplementation;
7+
8+
final class SkipInterfaceAsOnPurpose
9+
{
10+
public function create(): TalkInterface
11+
{
12+
return new ConferenceTalkImplementation();
13+
}
14+
}

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/skip_multiple_return_types.php.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,3 @@ final class MixedFactory
1313
return new \stdClass();
1414
}
1515
}
16-
17-
?>

rules-tests/TypeDeclaration/Rector/ClassMethod/NarrowObjectReturnTypeRector/Fixture/skip_non_final_class.php.inc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ class NonFinalFactory
1111
return new ConferenceTalk();
1212
}
1313
}
14-
15-
?>

0 commit comments

Comments
 (0)