Updated Rector to commit eae3e2c7e9a82537b31b5ca382b7665bc4e2f5fd

eae3e2c7e9 [e2e][Printer] Handle crash indentation on AddParamBasedOnParentClassMethodRector (#6112)
This commit is contained in:
Tomas Votruba 2024-07-12 09:32:13 +00:00
parent 90fe72a634
commit 8ae3b50fdb
10 changed files with 39 additions and 34 deletions

View File

@ -199,7 +199,7 @@ CODE_SAMPLE
if (!$param->default instanceof Expr) {
throw new ShouldNotHappenException('Previous position does not have default value');
}
$node->args[$index] = new Arg($this->nodeFactory->createReprintedExpr($param->default));
$node->args[$index] = new Arg($this->nodeFactory->createReprintedNode($param->default));
}
}
/**

View File

@ -261,7 +261,7 @@ final class AnonymousFunctionFactory
if (!$paramDefaultExpr instanceof Expr) {
return null;
}
return $this->nodeFactory->createReprintedExpr($paramDefaultExpr);
return $this->nodeFactory->createReprintedNode($paramDefaultExpr);
}
/**
* @param Param[] $params

View File

@ -199,7 +199,7 @@ CODE_SAMPLE
}
$paramDefault = $parentClassMethodParam->default;
if ($paramDefault instanceof Expr) {
$paramDefault = $this->nodeFactory->createReprintedExpr($paramDefault);
$paramDefault = $this->nodeFactory->createReprintedNode($paramDefault);
}
$paramName = $this->nodeNameResolver->getName($parentClassMethodParam);
$paramType = $this->resolveParamType($parentClassMethodParam);
@ -219,9 +219,7 @@ CODE_SAMPLE
if ($param->type === null) {
return null;
}
$paramType = $param->type;
$paramType->setAttribute(AttributeKey::ORIGINAL_NODE, null);
return $paramType;
return $this->nodeFactory->createReprintedNode($param->type);
}
/**
* @return string[]

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '2a14c30a574d0c539ba289fd1447accd4a15ee17';
public const PACKAGE_VERSION = 'eae3e2c7e9a82537b31b5ca382b7665bc4e2f5fd';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-07-12 10:42:59';
public const RELEASE_DATE = '2024-07-12 09:29:37';
/**
* @var int
*/

View File

@ -318,15 +318,24 @@ final class NodeFactory
}
return $this->createBooleanAndFromNodes($newNodes);
}
public function createReprintedExpr(Expr $expr) : Expr
/**
* Setting all child nodes to null is needed to avoid reprint of invalid tokens
* @see https://github.com/rectorphp/rector/issues/8712
*
* @template TNode as Node
*
* @param TNode $node
* @return TNode
*/
public function createReprintedNode(Node $node) : Node
{
// reset original node, to allow the printer to re-use the expr
$expr->setAttribute(AttributeKey::ORIGINAL_NODE, null);
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($expr, static function (Node $node) : Node {
$node->setAttribute(AttributeKey::ORIGINAL_NODE, null);
return $node;
// reset original node, to allow the printer to re-use the node
$node->setAttribute(AttributeKey::ORIGINAL_NODE, null);
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($node, static function (Node $subNode) : Node {
$subNode->setAttribute(AttributeKey::ORIGINAL_NODE, null);
return $subNode;
});
return $expr;
return $node;
}
/**
* @param string|int|null $key

View File

@ -143,17 +143,17 @@
},
{
"name": "composer\/semver",
"version": "3.4.0",
"version_normalized": "3.4.0.0",
"version": "3.4.1",
"version_normalized": "3.4.1.0",
"source": {
"type": "git",
"url": "https:\/\/github.com\/composer\/semver.git",
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32"
"reference": "8536c1b9103405bcbd310c69e7a5739a1c2b1f0b"
},
"dist": {
"type": "zip",
"url": "https:\/\/api.github.com\/repos\/composer\/semver\/zipball\/35e8d0af4486141bc745f23a29cc2091eb624a32",
"reference": "35e8d0af4486141bc745f23a29cc2091eb624a32",
"url": "https:\/\/api.github.com\/repos\/composer\/semver\/zipball\/8536c1b9103405bcbd310c69e7a5739a1c2b1f0b",
"reference": "8536c1b9103405bcbd310c69e7a5739a1c2b1f0b",
"shasum": ""
},
"require": {
@ -163,7 +163,7 @@
"phpstan\/phpstan": "^1.4",
"symfony\/phpunit-bridge": "^4.2 || ^5"
},
"time": "2023-08-31T09:50:34+00:00",
"time": "2024-07-12T09:13:09+00:00",
"type": "library",
"extra": {
"branch-alias": {
@ -207,7 +207,7 @@
"support": {
"irc": "ircs:\/\/irc.libera.chat:6697\/composer",
"issues": "https:\/\/github.com\/composer\/semver\/issues",
"source": "https:\/\/github.com\/composer\/semver\/tree\/3.4.0"
"source": "https:\/\/github.com\/composer\/semver\/tree\/3.4.1"
},
"funding": [
{

File diff suppressed because one or more lines are too long

View File

@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
### [3.4.1] 2024-07-12
* Fixed normalizeStability's return type to enforce valid stabilities
### [3.4.0] 2023-08-31
* Support larger major version numbers (#149)
@ -179,6 +183,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint`
* Changed: code style using php-cs-fixer.
[3.4.1]: https://github.com/composer/semver/compare/3.4.0...3.4.1
[3.4.0]: https://github.com/composer/semver/compare/3.3.2...3.4.0
[3.3.2]: https://github.com/composer/semver/compare/3.3.1...3.3.2
[3.3.1]: https://github.com/composer/semver/compare/3.3.0...3.3.1

View File

@ -1,11 +0,0 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$operator of class Composer\\\\Semver\\\\Constraint\\\\Constraint constructor expects '\\!\\='\\|'\\<'\\|'\\<\\='\\|'\\<\\>'\\|'\\='\\|'\\=\\='\\|'\\>'\\|'\\>\\=', non\\-falsy\\-string given\\.$#"
count: 1
path: src/VersionParser.php
-
message: "#^Strict comparison using \\=\\=\\= between null and non\\-empty\\-string will always evaluate to false\\.$#"
count: 2
path: src/VersionParser.php

View File

@ -72,10 +72,14 @@ class VersionParser
* @param string $stability
*
* @return string
* @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev'
*/
public static function normalizeStability($stability)
{
$stability = \strtolower((string) $stability);
if (!\in_array($stability, ['stable', 'rc', 'beta', 'alpha', 'dev'], \true)) {
throw new \InvalidArgumentException('Invalid stability string "' . $stability . '", expected one of stable, RC, beta, alpha or dev');
}
return $stability === 'rc' ? 'RC' : $stability;
}
/**