mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-17 05:18:18 +01:00
Updated Rector to commit 2b2bbd1a155e78d5a87deac346e1c9a11b316582
2b2bbd1a15
rebuild docs (#6107)
This commit is contained in:
parent
f0ee411314
commit
17d995ab91
@ -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
|
||||
|
@ -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
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user