mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-05 02:40:50 +00:00
Updated Rector to commit 7afec9a02c39848257341c4d2d08e1ddf52bc58b
7afec9a02c
Add unique PHP 8.1 constraints (#5612)
This commit is contained in:
parent
f863e8b003
commit
b9e54635e9
|
@ -150,7 +150,7 @@ CODE_SAMPLE
|
|||
return null;
|
||||
}
|
||||
$uses = $this->useImportsResolver->resolveBareUses();
|
||||
// 1. bare tags without annotation class, e.g. "@inject"
|
||||
// 1. bare tags without annotation class, e.g. "@require"
|
||||
$genericAttributeGroups = $this->processGenericTags($phpDocInfo);
|
||||
// 2. Doctrine annotation classes
|
||||
$annotationAttributeGroups = $this->processDoctrineAnnotationClasses($phpDocInfo, $uses);
|
||||
|
|
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '7de77e518f7b47b7c7ba0d96152d4acdad958639';
|
||||
public const PACKAGE_VERSION = '7afec9a02c39848257341c4d2d08e1ddf52bc58b';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-02-12 22:53:21';
|
||||
public const RELEASE_DATE = '2024-02-13 11:42:42';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -150,10 +150,10 @@ final class DoctrineAnnotationDecorator implements PhpDocNodeDecoratorInterface
|
|||
if (\strncmp($otherText, '@\\', \strlen('@\\')) !== 0 && \trim($otherText) !== '') {
|
||||
$phpDocNode->children[$key] = new PhpDocTextNode($otherText);
|
||||
\array_splice($phpDocNode->children, $key + 1, 0, $spacelessPhpDocTagNodes);
|
||||
} else {
|
||||
unset($phpDocNode->children[$key]);
|
||||
\array_splice($phpDocNode->children, $key, 0, $spacelessPhpDocTagNodes);
|
||||
return;
|
||||
}
|
||||
unset($phpDocNode->children[$key]);
|
||||
\array_splice($phpDocNode->children, $key, 0, $spacelessPhpDocTagNodes);
|
||||
}
|
||||
private function transformGenericTagValueNodesToDoctrineAnnotationTagValueNodes(PhpDocNode $phpDocNode, Node $currentPhpNode) : void
|
||||
{
|
||||
|
@ -300,14 +300,25 @@ final class DoctrineAnnotationDecorator implements PhpDocNodeDecoratorInterface
|
|||
}
|
||||
$nestedAnnotationOpen = \explode('(', (string) $fullyQualifiedAnnotationClass);
|
||||
$fullyQualifiedAnnotationClass = $nestedAnnotationOpen[0];
|
||||
$annotationContent = $match['annotation_content'] ?? null;
|
||||
$tagName = '@\\' . $fullyQualifiedAnnotationClass;
|
||||
$formerStartEnd = $phpDocTextNode->getAttribute(PhpDocAttributeKey::START_AND_END);
|
||||
if (isset($nestedAnnotationOpen[1])) {
|
||||
$annotationContent = '("' . \trim($nestedAnnotationOpen[1], '"\'') . '")';
|
||||
}
|
||||
$annotationContent = $this->resolveAnnotationContent($match['annotation_content'] ?? '', $nestedAnnotationOpen);
|
||||
$spacelessPhpDocTagNodes[] = $this->createDoctrineSpacelessPhpDocTagNode($annotationContent, $tagName, $fullyQualifiedAnnotationClass, $formerStartEnd, $currentPhpNode);
|
||||
}
|
||||
return $spacelessPhpDocTagNodes;
|
||||
}
|
||||
/**
|
||||
* @param string[]|null[] $nestedAnnotationOpen
|
||||
*/
|
||||
private function resolveAnnotationContent(string $annotationContent, array $nestedAnnotationOpen) : string
|
||||
{
|
||||
if (!isset($nestedAnnotationOpen[1])) {
|
||||
return $annotationContent;
|
||||
}
|
||||
$trimmedNestedAnnotationOpen = \trim($nestedAnnotationOpen[1]);
|
||||
if (\substr_compare($trimmedNestedAnnotationOpen, '{', -\strlen('{')) === 0) {
|
||||
return $annotationContent;
|
||||
}
|
||||
return '("' . \trim($trimmedNestedAnnotationOpen, '"\'') . '")';
|
||||
}
|
||||
}
|
||||
|
|
8
vendor/composer/installed.json
vendored
8
vendor/composer/installed.json
vendored
|
@ -1679,12 +1679,12 @@
|
|||
"source": {
|
||||
"type": "git",
|
||||
"url": "https:\/\/github.com\/rectorphp\/rector-doctrine.git",
|
||||
"reference": "05651f624036cf0df0b81606373d755321e0b6f4"
|
||||
"reference": "40da7a94030e86caaa3b03feb6e98bae301833e5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/05651f624036cf0df0b81606373d755321e0b6f4",
|
||||
"reference": "05651f624036cf0df0b81606373d755321e0b6f4",
|
||||
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-doctrine\/zipball\/40da7a94030e86caaa3b03feb6e98bae301833e5",
|
||||
"reference": "40da7a94030e86caaa3b03feb6e98bae301833e5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1708,7 +1708,7 @@
|
|||
"tomasvotruba\/unused-public": "^0.3",
|
||||
"tracy\/tracy": "^2.10"
|
||||
},
|
||||
"time": "2024-02-12T17:03:04+00:00",
|
||||
"time": "2024-02-13T00:25:55+00:00",
|
||||
"default-branch": true,
|
||||
"type": "rector-extension",
|
||||
"extra": {
|
||||
|
|
2
vendor/composer/installed.php
vendored
2
vendor/composer/installed.php
vendored
File diff suppressed because one or more lines are too long
|
@ -9,7 +9,7 @@ namespace Rector\RectorInstaller;
|
|||
*/
|
||||
final class GeneratedConfig
|
||||
{
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 05651f6'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 8d1aab2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main cdbe390'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 59edb62'));
|
||||
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 40da7a9'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main 8d1aab2'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main cdbe390'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main 59edb62'));
|
||||
private function __construct()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ final class EmbeddedPropertyAnnotationTransformer implements PropertyAnnotationT
|
|||
if ($propertyMapping === null) {
|
||||
return;
|
||||
}
|
||||
unset($propertyMapping['nullable']);
|
||||
$arrayItemNodes = $this->arrayItemNodeFactory->create($propertyMapping, ['class', 'columnPrefix']);
|
||||
$spacelessPhpDocTagNode = DocTagNodeFactory::createSpacelessPhpDocTagNode($arrayItemNodes, $this->getClassName());
|
||||
$propertyPhpDocInfo->addPhpDocTagNode($spacelessPhpDocTagNode);
|
||||
|
|
Loading…
Reference in New Issue
Block a user