Updated Rector to commit 2b2bbd1a155e78d5a87deac346e1c9a11b316582

2b2bbd1a15 rebuild docs (#6107)
This commit is contained in:
Tomas Votruba 2024-07-03 13:51:41 +00:00
parent f0ee411314
commit 17d995ab91
2 changed files with 19 additions and 70 deletions

View File

@ -1,4 +1,4 @@
# 379 Rules Overview
# 376 Rules Overview
<br>
@ -60,7 +60,7 @@
- [Transform](#transform) (25)
- [TypeDeclaration](#typedeclaration) (55)
- [TypeDeclaration](#typedeclaration) (52)
- [Visibility](#visibility) (3)
@ -6436,72 +6436,6 @@ Add "never" return-type for closure that never return anything
<br>
### AddClosureReturnTypeFromReturnCastRector
Add return type to closure with return cast
- class: [`Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeFromReturnCastRector`](../rules/TypeDeclaration/Rector/Closure/AddClosureReturnTypeFromReturnCastRector.php)
```diff
-function ($param) {
+function ($param): string {
return (string) $param;
};
```
<br>
### AddClosureReturnTypeFromStrictNativeCallRector
Add closure strict return type based native function or native method
- class: [`Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeFromStrictNativeCallRector`](../rules/TypeDeclaration/Rector/Closure/AddClosureReturnTypeFromStrictNativeCallRector.php)
```diff
-function () {
+function (): string {
$dt = new DateTime('now');
return $dt->format('Y-m-d');
};
```
<br>
### AddClosureReturnTypeFromStrictParamRector
Add closure return type based on strict parameter type
- class: [`Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeFromStrictParamRector`](../rules/TypeDeclaration/Rector/Closure/AddClosureReturnTypeFromStrictParamRector.php)
```diff
-function(ParamType $item)
+function(ParamType $item): ParamType
{
return $item;
};
```
<br>
### AddClosureUnionReturnTypeRector
Add union return type on closure
- class: [`Rector\TypeDeclaration\Rector\Closure\AddClosureUnionReturnTypeRector`](../rules/TypeDeclaration/Rector/Closure/AddClosureUnionReturnTypeRector.php)
```diff
-function () {
+function (): int|string {
if (rand(0, 1)) {
return 1;
}
return 'one';
};
```
<br>
### AddClosureVoidReturnTypeWhereNoReturnRector
Add closure return type void if there is no return
@ -6884,6 +6818,21 @@ Add return type to classes that extend `Doctrine\ORM\EntityRepository` based on
<br>
### ClosureReturnTypeRector
Add return type to closures based on known return values
- class: [`Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector`](../rules/TypeDeclaration/Rector/Closure/ClosureReturnTypeRector.php)
```diff
-function () {
+function (): int {
return 100;
};
```
<br>
### DeclareStrictTypesRector
Add declare(strict_types=1) if missing

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = 'fd5f15c7987257b5247bc05e36a932a4cccc29cc';
public const PACKAGE_VERSION = '2b2bbd1a155e78d5a87deac346e1c9a11b316582';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-07-03 12:44:47';
public const RELEASE_DATE = '2024-07-03 15:49:12';
/**
* @var int
*/