<?php
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
#[Route(
'/admin',
name: 'admin.',
defaults: [
'_require_identity' => 'xxx',
'_exception_handle' => 'xxx',
'_roles' => ['xxx'],
]
)]
class SomeController extends AbstractController
{
#[Route(
'/actions/demo',
name: 'actions.demo',
defaults: [
'_roles' => ['yyy'],
],
methods: ['POST']
)]
public function actionsDemo()
{
return $this->json([]);
}
#[Route(
'/actions/demo2',
name: 'actions.demo2',
defaults: [
'_roles' => ['yyy2'],
],
methods: ['POST']
)]
public function actionsDemoTwo()
{
return $this->json([]);
}
}
Bug Report
Minimal PHP Code Causing Issue
See https://getrector.com/demo/1b49f49d-810a-4e6d-b7a9-7903a2fde5e9
Responsible rules
InlineClassRoutePrefixRectorExpected Behavior
defaultsfrom the class. The name implies it only deals with prefixes.