mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-01 00:40:52 +00:00
Updated Rector to commit 5a156bea4f702a08d45928c783daf3153c6bd2de
5a156bea4f
[Php80] Handle NestedAnnotationToAttributeRector with empty new line (#5448)
This commit is contained in:
parent
503f4ead06
commit
cc3c45157f
|
@ -19,12 +19,12 @@ final class VersionResolver
|
|||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const PACKAGE_VERSION = '0.19.0';
|
||||
public const PACKAGE_VERSION = '5a156bea4f702a08d45928c783daf3153c6bd2de';
|
||||
/**
|
||||
* @api
|
||||
* @var string
|
||||
*/
|
||||
public const RELEASE_DATE = '2024-01-09 01:02:09';
|
||||
public const RELEASE_DATE = '2024-01-09 15:49:28';
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
declare (strict_types=1);
|
||||
namespace Rector\BetterPhpDocParser\PhpDocParser;
|
||||
|
||||
use RectorPrefix202401\Nette\Utils\Strings;
|
||||
use PhpParser\Node;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocChildNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode;
|
||||
use PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocTagNode;
|
||||
|
@ -41,6 +43,11 @@ final class BetterPhpDocParser extends PhpDocParser
|
|||
* @var \Rector\Util\Reflection\PrivatesAccessor
|
||||
*/
|
||||
private $privatesAccessor;
|
||||
/**
|
||||
* @var string
|
||||
* @see https://regex101.com/r/JOKSmr/1
|
||||
*/
|
||||
private const MULTI_NEW_LINES_REGEX = '#(\\n\\r|\\n){2,}#';
|
||||
/**
|
||||
* @param PhpDocNodeDecoratorInterface[] $phpDocNodeDecorators
|
||||
*/
|
||||
|
@ -109,6 +116,9 @@ final class BetterPhpDocParser extends PhpDocParser
|
|||
}
|
||||
$startAndEnd = new StartAndEnd($startPosition, $endPosition);
|
||||
$phpDocTagValueNode->setAttribute(PhpDocAttributeKey::START_AND_END, $startAndEnd);
|
||||
if ($phpDocTagValueNode instanceof GenericTagValueNode) {
|
||||
$phpDocTagValueNode->value = Strings::replace($phpDocTagValueNode->value, self::MULTI_NEW_LINES_REGEX, "\n");
|
||||
}
|
||||
return $phpDocTagValueNode;
|
||||
}
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user