From b6dc880669fca6bc532c9678b28e450aaa31b898 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 16 Jan 2025 10:06:07 +0000 Subject: [PATCH] Updated Rector to commit 354ef50368dd5e33e2ede598a418a26c997b5a7c https://github.com/rectorphp/rector-src/commit/354ef50368dd5e33e2ede598a418a26c997b5a7c [BetterPhpDocParser] Use str_starts_with() and str_starts_with() over str_contains() on DoctrineAnnotationDecorator (#6671) --- src/Application/VersionResolver.php | 4 ++-- .../PhpDocParser/DoctrineAnnotationDecorator.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Application/VersionResolver.php b/src/Application/VersionResolver.php index 3cac8abf876..b060c02ee44 100644 --- a/src/Application/VersionResolver.php +++ b/src/Application/VersionResolver.php @@ -19,12 +19,12 @@ final class VersionResolver * @api * @var string */ - public const PACKAGE_VERSION = '60857134fdd3e7eb935a721962c0866518e3471e'; + public const PACKAGE_VERSION = '354ef50368dd5e33e2ede598a418a26c997b5a7c'; /** * @api * @var string */ - public const RELEASE_DATE = '2025-01-16 07:06:47'; + public const RELEASE_DATE = '2025-01-16 17:03:44'; /** * @var int */ diff --git a/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php b/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php index fcb596fa20d..da73ceefd49 100644 --- a/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php +++ b/src/BetterPhpDocParser/PhpDocParser/DoctrineAnnotationDecorator.php @@ -313,10 +313,10 @@ final class DoctrineAnnotationDecorator implements PhpDocNodeDecoratorInterface return \true; } do { - if ($composedTokenIterator->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET, Lexer::TOKEN_OPEN_PARENTHESES) || \strpos($composedTokenIterator->currentTokenValue(), '(') !== \false) { + if ($composedTokenIterator->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET, Lexer::TOKEN_OPEN_PARENTHESES) || \strncmp($composedTokenIterator->currentTokenValue(), '{', \strlen('{')) === 0 || \strncmp($composedTokenIterator->currentTokenValue(), '(', \strlen('(')) === 0) { ++$openBracketCount; } - if ($composedTokenIterator->isCurrentTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET, Lexer::TOKEN_CLOSE_PARENTHESES) || \strpos($composedTokenIterator->currentTokenValue(), '}') !== \false || \strpos($composedTokenIterator->currentTokenValue(), ')') !== \false) { + if ($composedTokenIterator->isCurrentTokenType(Lexer::TOKEN_CLOSE_CURLY_BRACKET, Lexer::TOKEN_CLOSE_PARENTHESES) || \substr_compare($composedTokenIterator->currentTokenValue(), '}', -\strlen('}')) === 0 || \substr_compare($composedTokenIterator->currentTokenValue(), ')', -\strlen(')')) === 0) { ++$closeBracketCount; } $composedTokenIterator->next();