mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 10:50:48 +00:00
Updated Rector to commit 5c8fa12ec90e4d4b55fd05f48509c538c243482d
5c8fa12ec9
[Doc] Typo fix on sample code documentation on SimplifyForeachToCoalescingRector (#5308)
This commit is contained in:
parent
cb8a63ca31
commit
b698053254
|
@ -1111,12 +1111,12 @@ Changes foreach that returns set value to ??
|
||||||
```diff
|
```diff
|
||||||
-foreach ($this->oldToNewFunctions as $oldFunction => $newFunction) {
|
-foreach ($this->oldToNewFunctions as $oldFunction => $newFunction) {
|
||||||
- if ($currentFunction === $oldFunction) {
|
- if ($currentFunction === $oldFunction) {
|
||||||
- innerForeachReturn $newFunction;
|
- return $newFunction;
|
||||||
- }
|
- }
|
||||||
-}
|
-}
|
||||||
-
|
-
|
||||||
-innerForeachReturn null;
|
-return null;
|
||||||
+innerForeachReturn $this->oldToNewFunctions[$currentFunction] ?? null;
|
+return $this->oldToNewFunctions[$currentFunction] ?? null;
|
||||||
```
|
```
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
|
|
|
@ -33,14 +33,14 @@ final class SimplifyForeachToCoalescingRector extends AbstractRector implements
|
||||||
return new RuleDefinition('Changes foreach that returns set value to ??', [new CodeSample(<<<'CODE_SAMPLE'
|
return new RuleDefinition('Changes foreach that returns set value to ??', [new CodeSample(<<<'CODE_SAMPLE'
|
||||||
foreach ($this->oldToNewFunctions as $oldFunction => $newFunction) {
|
foreach ($this->oldToNewFunctions as $oldFunction => $newFunction) {
|
||||||
if ($currentFunction === $oldFunction) {
|
if ($currentFunction === $oldFunction) {
|
||||||
innerForeachReturn $newFunction;
|
return $newFunction;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
innerForeachReturn null;
|
return null;
|
||||||
CODE_SAMPLE
|
CODE_SAMPLE
|
||||||
, <<<'CODE_SAMPLE'
|
, <<<'CODE_SAMPLE'
|
||||||
innerForeachReturn $this->oldToNewFunctions[$currentFunction] ?? null;
|
return $this->oldToNewFunctions[$currentFunction] ?? null;
|
||||||
CODE_SAMPLE
|
CODE_SAMPLE
|
||||||
)]);
|
)]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const PACKAGE_VERSION = '71c22e20d9a3b2ba187515711b13fca40b595d93';
|
public const PACKAGE_VERSION = '5c8fa12ec90e4d4b55fd05f48509c538c243482d';
|
||||||
/**
|
/**
|
||||||
* @api
|
* @api
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public const RELEASE_DATE = '2023-12-02 11:49:23';
|
public const RELEASE_DATE = '2023-12-02 05:03:12';
|
||||||
/**
|
/**
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user