mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-27 13:13:31 +00:00
fix bracket mallform in annotations
This commit is contained in:
parent
062c323802
commit
c00b8d4b75
|
@ -53,7 +53,9 @@ abstract class AbstractTagValueNode implements AttributeAwareNodeInterface, PhpD
|
||||||
{
|
{
|
||||||
$json = Json::encode($item);
|
$json = Json::encode($item);
|
||||||
$json = Strings::replace($json, '#,#', ', ');
|
$json = Strings::replace($json, '#,#', ', ');
|
||||||
$json = Strings::replace($json, '#\[(.*?)\]#', '{$1}');
|
|
||||||
|
// change brackets from json to annotations
|
||||||
|
$json = Strings::replace($json, '#^\[(.*?)\]$#', '{$1}');
|
||||||
|
|
||||||
// cleanup json encoded extra slashes
|
// cleanup json encoded extra slashes
|
||||||
$json = Strings::replace($json, '#\\\\\\\\#', '\\');
|
$json = Strings::replace($json, '#\\\\\\\\#', '\\');
|
||||||
|
|
|
@ -128,9 +128,6 @@ final class SymfonyRouteTagValueNode extends AbstractTagValueNode implements Sho
|
||||||
return $this->printContentItems($contentItems);
|
return $this->printContentItems($contentItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param mixed[] $methods
|
|
||||||
*/
|
|
||||||
public function changeMethods(array $methods): void
|
public function changeMethods(array $methods): void
|
||||||
{
|
{
|
||||||
$this->orderedVisibleItems[] = 'methods';
|
$this->orderedVisibleItems[] = 'methods';
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
/**
|
||||||
|
* @Route("/demo/{letter}", requirements={"letter"="[a-z]{1}"})
|
||||||
|
*/
|
|
@ -9,7 +9,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||||
class WithRouteOptions extends AbstractController
|
class WithRouteOptions extends AbstractController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @Route("/{category}", name="report_overview", defaults={"category":null}, requirements={"category":"\d+"})
|
* @Route("/{category}", name="report_overview", defaults={"category":null}, requirements={"category":"[a-z]\d+"})
|
||||||
* @Template("PAPPReportBundle:Report:report_list.html.twig")
|
* @Template("PAPPReportBundle:Report:report_list.html.twig")
|
||||||
*/
|
*/
|
||||||
public function index($category = null)
|
public function index($category = null)
|
||||||
|
@ -33,7 +33,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||||
class WithRouteOptions extends AbstractController
|
class WithRouteOptions extends AbstractController
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @Route("/{category}", name="report_overview", defaults={"category":null}, requirements={"category":"\d+"})
|
* @Route("/{category}", name="report_overview", defaults={"category":null}, requirements={"category":"[a-z]\d+"})
|
||||||
*/
|
*/
|
||||||
public function index($category = null): \Symfony\Component\HttpFoundation\Response
|
public function index($category = null): \Symfony\Component\HttpFoundation\Response
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user