mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-29 11:33:33 +01:00
Updated Rector to commit 539cfeb35c55cec4b2b5b20045cfdc4a437728f4
539cfeb35c
[BetterPhpDocParser] Move split new line with @\ to regex to support windows new line (#5615)
This commit is contained in:
parent
adf6cdfc87
commit
d85a9f8be0
@ -19,12 +19,12 @@ final class VersionResolver
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '95f9772f17b436fce469f68b1ed09445131235ee';
|
||||
public const PACKAGE_VERSION = '539cfeb35c55cec4b2b5b20045cfdc4a437728f4';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-02-13 12:05:45';
|
||||
public const RELEASE_DATE = '2024-02-13 17:46:10';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
@ -59,6 +59,11 @@ final class DoctrineAnnotationDecorator implements PhpDocNodeDecoratorInterface
|
||||
* @var string
|
||||
*/
|
||||
private const NESTED_ANNOTATION_END_REGEX = '#(\\s+)?\\}\\)(\\s+)?#';
|
||||
/**
|
||||
* @see https://regex101.com/r/8rWY4r/1
|
||||
* @var string
|
||||
*/
|
||||
private const NEWLINE_ANNOTATION_FQCN_REGEX = '#\\r?\\n@\\\\#';
|
||||
public function __construct(\Rector\BetterPhpDocParser\PhpDocParser\ClassAnnotationMatcher $classAnnotationMatcher, \Rector\BetterPhpDocParser\PhpDocParser\StaticDoctrineAnnotationParser $staticDoctrineAnnotationParser, TokenIteratorFactory $tokenIteratorFactory, AttributeMirrorer $attributeMirrorer)
|
||||
{
|
||||
$this->classAnnotationMatcher = $classAnnotationMatcher;
|
||||
@ -145,9 +150,9 @@ final class DoctrineAnnotationDecorator implements PhpDocNodeDecoratorInterface
|
||||
if ($spacelessPhpDocTagNodes === []) {
|
||||
return;
|
||||
}
|
||||
$texts = \explode("\n@\\", $phpDocTextNode->text);
|
||||
$texts = Strings::split($phpDocTextNode->text, self::NEWLINE_ANNOTATION_FQCN_REGEX);
|
||||
$otherText = $texts[0];
|
||||
if (\strncmp($otherText, '@\\', \strlen('@\\')) !== 0 && \trim($otherText) !== '') {
|
||||
if (\strncmp((string) $otherText, '@\\', \strlen('@\\')) !== 0 && \trim((string) $otherText) !== '') {
|
||||
$phpDocNode->children[$key] = new PhpDocTextNode($otherText);
|
||||
\array_splice($phpDocNode->children, $key + 1, 0, $spacelessPhpDocTagNodes);
|
||||
return;
|
||||
@ -196,7 +201,7 @@ final class DoctrineAnnotationDecorator implements PhpDocNodeDecoratorInterface
|
||||
continue;
|
||||
}
|
||||
Assert::isAOf($phpDocNode->children[$key], PhpDocTagNode::class);
|
||||
$texts = \explode("\n@\\", $phpDocChildNode->value->value);
|
||||
$texts = Strings::split($phpDocChildNode->value->value, self::NEWLINE_ANNOTATION_FQCN_REGEX);
|
||||
$phpDocNode->children[$key]->value = new GenericTagValueNode($texts[0]);
|
||||
$phpDocNode->children[$key]->value->setAttribute(PhpDocAttributeKey::START_AND_END, $startAndEnd);
|
||||
$spacelessPhpDocTagNode = $this->createSpacelessPhpDocTagNode($phpDocNode->children[$key]->name, $phpDocNode->children[$key]->value, $fullyQualifiedAnnotationClass, $currentPhpNode);
|
||||
|
2
vendor/scoper-autoload.php
vendored
2
vendor/scoper-autoload.php
vendored
@ -14,7 +14,7 @@ $loader = (static function () {
|
||||
// Restore the backup and ensure the excluded files are properly marked as loaded
|
||||
$GLOBALS['__composer_autoload_files'] = \array_merge(
|
||||
$existingComposerAutoloadFiles,
|
||||
\array_fill_keys(['0e6d7bf4a5811bfa5cf40c5ccd6fae6a', '5928a00fa978807cf85d90ec3f4b0147'], true)
|
||||
\array_fill_keys(['5928a00fa978807cf85d90ec3f4b0147', '0e6d7bf4a5811bfa5cf40c5ccd6fae6a'], true)
|
||||
);
|
||||
|
||||
return $loader;
|
||||
|
Loading…
x
Reference in New Issue
Block a user