-
Notifications
You must be signed in to change notification settings - Fork 102
Description
sensio-framework-extra-bundle is abandoned.
Some attributes have been implemented in Symfony 6.2 and Rector can already refactor code for them.
But, Security
attribute will not be implemented in Symfony.
From what I know about Rector we can't currently make change from:
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
class PostController extends Controller
{
#[Security("is_granted('ROLE_ADMIN') and is_granted('ROLE_FRIENDLY_USER')")]
public function index()
{
}
}
to:
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\Security\Http\Attribute\IsGranted;
class PostController extends Controller
{
#[IsGranted(new Expression("is_granted('ROLE_ADMIN') and is_granted('ROLE_FRIENDLY_USER')"))]
public function index()
{
}
}
This require a new rule, something custom like this?
TomasVotruba
Metadata
Metadata
Assignees
Labels
No labels