Bump to Symplify 9.2.1 (#5655)

This commit is contained in:
Tomas Votruba 2021-02-22 21:05:33 +01:00 committed by GitHub
parent cbbd008f50
commit 5ba33240ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 30 deletions

View File

@ -48,16 +48,16 @@
"symfony/finder": "^4.4.8|^5.1",
"symfony/http-kernel": "^4.4.8|^5.1",
"symfony/process": "^4.4.8|^5.1",
"symplify/astral": "^9.1.9",
"symplify/autowire-array-parameter": "^9.1.9",
"symplify/console-color-diff": "^9.1.9",
"symplify/package-builder": "^9.1.9",
"symplify/rule-doc-generator": "^9.1.9",
"symplify/set-config-resolver": "^9.1.9",
"symplify/simple-php-doc-parser": "^9.1.9",
"symplify/skipper": "^9.1.9",
"symplify/smart-file-system": "^9.1.9",
"symplify/symfony-php-config": "^9.1.9",
"symplify/astral": "^9.2.1",
"symplify/autowire-array-parameter": "^9.2.1",
"symplify/console-color-diff": "^9.2.1",
"symplify/package-builder": "^9.2.1",
"symplify/rule-doc-generator": "^9.2.1",
"symplify/set-config-resolver": "^9.2.1",
"symplify/simple-php-doc-parser": "^9.2.1",
"symplify/skipper": "^9.2.1",
"symplify/smart-file-system": "^9.2.1",
"symplify/symfony-php-config": "^9.2.1",
"webmozart/assert": "^1.9"
},
"require-dev": {
@ -71,13 +71,13 @@
"phpunit/phpunit": "^9.5",
"symfony/security-core": "^5.2",
"symfony/security-http": "^5.2",
"symplify/changelog-linker": "^9.1.9",
"symplify/coding-standard": "^9.1.9",
"symplify/easy-coding-standard": "^9.1.9",
"symplify/changelog-linker": "^9.2.1",
"symplify/coding-standard": "^9.2.1",
"symplify/easy-coding-standard": "^9.2.1",
"symplify/easy-ci": "^9.1.0",
"symplify/easy-testing": "^9.1.9",
"symplify/phpstan-extensions": "^9.1.9",
"symplify/phpstan-rules": "^9.1.9",
"symplify/easy-testing": "^9.2.1",
"symplify/phpstan-extensions": "^9.2.1",
"symplify/phpstan-rules": "^9.2.1",
"tracy/tracy": "^2.8"
},
"replace": {

View File

@ -40,6 +40,12 @@ final class BetterPhpDocParser extends PhpDocParser
*/
private const TAG_REGEX = '#@(var|param|return|throws|property|deprecated)#';
/**
* @see https://regex101.com/r/iCJqCv/1
* @var string
*/
private const SPACE_REGEX = '#\s+#';
/**
* @var PhpDocNodeFactoryInterface[]
*/
@ -235,12 +241,14 @@ final class BetterPhpDocParser extends PhpDocParser
$originalContent = $this->getOriginalContentFromTokenIterator($tokenIterator);
// we try to match original content without trimmed spaces
$currentTextPattern = '#' . preg_quote($possibleMultilineText, '#') . '#s';
$currentTextPattern = Strings::replace($currentTextPattern, '#(\s)+#', '\s+');
$currentTextPattern = '#(?<line>' . preg_quote($possibleMultilineText, '#') . ')#s';
$currentTextPattern = Strings::replace($currentTextPattern, self::SPACE_REGEX, '\s+');
$match = Strings::match($originalContent, $currentTextPattern);
if (isset($match[0])) {
$attributeAwareNode->setAttribute(Attribute::ORIGINAL_CONTENT, $match[0]);
if (isset($match['line'])) {
$attributeAwareNode->setAttribute(Attribute::ORIGINAL_CONTENT, $match['line']);
}
}

View File

@ -517,3 +517,8 @@ parameters:
- '#Property PhpParser\\Node\\Param\:\:\$type \(PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType\|null\) does not accept PhpParser\\Node#'
- '#Parameter \#1 \$interfaces of method Rector\\PHPStanStaticTypeMapper\\TypeAnalyzer\\UnionTypeCommonTypeNarrower\:\:filterOutNativeInterfaces\(\) expects array<class\-string\>, array<string, string\> given#'
- '#Content of method "getFunctionLikePhpDocInfo\(\)" is duplicated with method "getFunctionLikePhpDocInfo\(\)" in "Rector\\TypeDeclaration\\TypeInferer\\ParamTypeInferer\\PHPUnitDataProviderParamTypeInferer" class\. Use unique content or abstract service instead#'
-
message: '#"%s" in sprintf\(\) format must be quoted#'
paths:
- packages/attribute-aware-php-doc/src/Ast/PhpDoc/AttributeAwareParamTagValueNode.php

View File

@ -37,11 +37,21 @@ final class EregToPcreTransformer
* @var string
* @see https://regex101.com/r/htpXFg/1
*/
private const BOUND_REGEX = '/^(\d|[1-9]\d|1\d\d|
private const BOUND_REGEX = '/^(?<' . self::MINIMAL_NUMBER_PART . '>\d|[1-9]\d|1\d\d|
2[0-4]\d|25[0-5])
(,(\d|[1-9]\d|1\d\d|
(?<comma>,(?<' . self::MAXIMAL_NUMBER_PART . '>\d|[1-9]\d|1\d\d|
2[0-4]\d|25[0-5])?)?$/x';
/**
* @var string
*/
private const MINIMAL_NUMBER_PART = 'minimal_number';
/**
* @var string
*/
private const MAXIMAL_NUMBER_PART = 'maximal_number';
/**
* @var string
*/
@ -275,19 +285,20 @@ final class EregToPcreTransformer
$bound = Strings::substring($s, $start, $length);
$matches = Strings::match($bound, self::BOUND_REGEX);
if (! $matches) {
if ($matches === null) {
throw new InvalidEregException('an invalid bound');
}
if (isset($matches[3])) {
if ($matches[1] > $matches[3]) {
if (isset($matches[self::MAXIMAL_NUMBER_PART])) {
if ($matches[self::MINIMAL_NUMBER_PART] > $matches[self::MAXIMAL_NUMBER_PART]) {
throw new InvalidEregException('an invalid bound');
}
$r[$rr] .= '{' . $matches[1] . ',' . $matches[3] . '}';
} elseif (isset($matches[2])) {
$r[$rr] .= '{' . $matches[1] . ',}';
$r[$rr] .= '{' . $matches[self::MINIMAL_NUMBER_PART] . ',' . $matches[self::MAXIMAL_NUMBER_PART] . '}';
} elseif (isset($matches['comma'])) {
$r[$rr] .= '{' . $matches[self::MINIMAL_NUMBER_PART] . ',}';
} else {
$r[$rr] .= '{' . $matches[1] . '}';
$r[$rr] .= '{' . $matches[self::MINIMAL_NUMBER_PART] . '}';
}
return $ii + 1;

View File

@ -135,7 +135,7 @@ services:
class: Symplify\PHPStanRules\Rules\RequireStringArgumentInMethodCallRule
tags: [phpstan.rules.rule]
arguments:
stringArgByMethodByType:
stringArgPositionByMethodByType:
Rector\Core\Rector\AbstractRector:
isObjectType: [1]