mirror of
https://github.com/rectorphp/rector.git
synced 2025-04-13 03:52:15 +02:00
Updated Rector to commit e1b032ef92c901037728b9bacb838b75d4908413
e1b032ef92
[Php81] Skip with next required on NewInInitializerRector (#6599)
This commit is contained in:
parent
22cf34f61c
commit
35244f0eda
@ -4,6 +4,7 @@ declare (strict_types=1);
|
||||
namespace Rector\Php81\Rector\ClassMethod;
|
||||
|
||||
use PhpParser\Node;
|
||||
use PhpParser\Node\Expr;
|
||||
use PhpParser\Node\Expr\BinaryOp\Coalesce;
|
||||
use PhpParser\Node\NullableType;
|
||||
use PhpParser\Node\Param;
|
||||
@ -178,6 +179,18 @@ CODE_SAMPLE
|
||||
if ($classMethod->stmts === null || $classMethod->stmts === []) {
|
||||
return [];
|
||||
}
|
||||
return \array_filter($classMethod->params, static fn(Param $param): bool => $param->type instanceof NullableType);
|
||||
$params = \array_filter($classMethod->params, static fn(Param $param): bool => $param->type instanceof NullableType);
|
||||
if ($params === []) {
|
||||
return $params;
|
||||
}
|
||||
$totalParams = \count($classMethod->params);
|
||||
foreach (\array_keys($params) as $key) {
|
||||
for ($iteration = $key + 1; $iteration < $totalParams; ++$iteration) {
|
||||
if (isset($classMethod->params[$iteration]) && !$classMethod->params[$iteration]->default instanceof Expr) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
}
|
||||
|
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '0efbe133dbbeb1f4d9335680bfb54f391f9533d1';
|
||||
public const PACKAGE_VERSION = 'e1b032ef92c901037728b9bacb838b75d4908413';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-12-17 18:56:04';
|
||||
public const RELEASE_DATE = '2024-12-18 04:54:46';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
@ -512,8 +512,8 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate\/container",
|
||||
"version": "v11.35.1",
|
||||
"version_normalized": "11.35.1.0",
|
||||
"version": "v11.36.0",
|
||||
"version_normalized": "11.36.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/illuminate\/container.git",
|
||||
@ -569,8 +569,8 @@
|
||||
},
|
||||
{
|
||||
"name": "illuminate\/contracts",
|
||||
"version": "v11.35.1",
|
||||
"version_normalized": "11.35.1.0",
|
||||
"version": "v11.36.0",
|
||||
"version_normalized": "11.36.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/illuminate\/contracts.git",
|
||||
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user