mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-29 14:13:30 +00:00
add sensio tag to one with = instead of :
This commit is contained in:
parent
e35b506fd0
commit
fa5319bf74
|
@ -12,6 +12,7 @@ use Rector\BetterPhpDocParser\Contract\Doctrine\DoctrineTagNodeInterface;
|
|||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\AttributeAwareNodeInterface;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\SilentKeyNodeInterface;
|
||||
use Rector\BetterPhpDocParser\Contract\PhpDocNode\TagAwareNodeInterface;
|
||||
use Rector\BetterPhpDocParser\PhpDocNode\Sensio\SensioRouteTagValueNode;
|
||||
use Rector\BetterPhpDocParser\PhpDocNode\Symfony\SymfonyRouteTagValueNode;
|
||||
use Rector\BetterPhpDocParser\Utils\ArrayItemStaticHelper;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
@ -151,7 +152,7 @@ abstract class AbstractTagValueNode implements AttributeAwareNodeInterface, PhpD
|
|||
$json = Strings::replace($json, '#\\\\\\\\#', '\\');
|
||||
|
||||
// replace ":" with "=" for @Route
|
||||
if ($this instanceof SymfonyRouteTagValueNode || $this instanceof DoctrineTagNodeInterface) {
|
||||
if ($this instanceof SymfonyRouteTagValueNode || $this instanceof DoctrineTagNodeInterface || $this instanceof SensioRouteTagValueNode) {
|
||||
// @see https://regex101.com/r/XfKi4A/1/
|
||||
$json = Strings::replace($json, '#(\"|\w)\:(\"|\w)#', '$1=$2');
|
||||
}
|
||||
|
|
|
@ -23,6 +23,11 @@ use Symplify\SmartFileSystem\SmartFileInfo;
|
|||
|
||||
final class NodeNameResolver
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public const FILE = 'file';
|
||||
|
||||
/**
|
||||
* @var NodeNameResolverInterface[]
|
||||
*/
|
||||
|
@ -219,11 +224,11 @@ final class NodeNameResolver
|
|||
|
||||
if ($rectorBacktrace) {
|
||||
// issues to find the file in prefixed
|
||||
if (file_exists($rectorBacktrace['file'])) {
|
||||
$fileInfo = new SmartFileInfo($rectorBacktrace['file']);
|
||||
if (file_exists($rectorBacktrace[self::FILE])) {
|
||||
$fileInfo = new SmartFileInfo($rectorBacktrace[self::FILE]);
|
||||
$fileAndLine = $fileInfo->getRelativeFilePathFromCwd() . ':' . $rectorBacktrace['line'];
|
||||
} else {
|
||||
$fileAndLine = $rectorBacktrace['file'] . ':' . $rectorBacktrace['line'];
|
||||
$fileAndLine = $rectorBacktrace[self::FILE] . ':' . $rectorBacktrace['line'];
|
||||
}
|
||||
|
||||
$message .= PHP_EOL . PHP_EOL;
|
||||
|
|
Loading…
Reference in New Issue
Block a user