Skip to content

Commit

Permalink
[TypeDeclaration] Remove and disable breaking ReturnTypeDeclarationRe…
Browse files Browse the repository at this point in the history
…ctor, use split rules instead (#3120)
  • Loading branch information
TomasVotruba committed Nov 28, 2022
1 parent 696ddd9 commit 3253877
Show file tree
Hide file tree
Showing 132 changed files with 37 additions and 3,514 deletions.
26 changes: 24 additions & 2 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 405 Rules Overview
# 406 Rules Overview

<br>

Expand Down Expand Up @@ -64,7 +64,7 @@

- [Transform](#transform) (34)

- [TypeDeclaration](#typedeclaration) (33)
- [TypeDeclaration](#typedeclaration) (34)

- [Visibility](#visibility) (3)

Expand Down Expand Up @@ -8971,6 +8971,28 @@ Add missing return type declaration based on parent class method

<br>

### AddReturnTypeDeclarationFromYieldsRector

Add return type declarations from yields

- class: [`Rector\TypeDeclaration\Rector\FunctionLike\AddReturnTypeDeclarationFromYieldsRector`](../rules/TypeDeclaration/Rector/FunctionLike/AddReturnTypeDeclarationFromYieldsRector.php)

```diff
class SomeClass
{
- public function provide()
+ /**
+ * @return Iterator<int>
+ */
+ public function provide(): Iterator
{
yield 1;
}
}
```

<br>

### AddReturnTypeDeclarationRector

Changes defined return typehint of method and class.
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
"stubs/Doctrine/Persistence/ObjectManager.php",
"stubs/Doctrine/Common/Persistence/ObjectManager.php",
"rules-tests/Transform/Rector/FuncCall/FuncCallToMethodCallRector/Source/some_view_function.php",
"rules-tests/TypeDeclaration/Rector/FunctionLike/ReturnTypeDeclarationRector/Source/MyBar.php",
"rules-tests/TypeDeclaration/Rector/ClassMethod/ParamTypeByMethodCallTypeRector/Source/FunctionTyped.php"
]
},
Expand Down
3 changes: 3 additions & 0 deletions easy-ci.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,8 @@
NamespacedNameDecorator::class,
NamedVariableFactory::class,
BinaryOpTreeRootLocator::class,

// create own rule to handle this
\Rector\TypeDeclaration\PhpDocParser\NonInformativeReturnTagRemover::class,
]);
};

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 3253877

Please sign in to comment.