-
Notifications
You must be signed in to change notification settings - Fork 102
Closed
Description
In the blog from Symfony https://symfony.com/blog/new-in-symfony-6-2-built-in-cache-security-template-and-doctrine-attributes its explained new attributes are introduced to replace the once from SensioFrameworkExtraBundle.
We need a few changes:
Replace attributes IsGranted
and Cache
:
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
+use Symfony\Component\Security\Http\Attribute\IsGranted;
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
+use Symfony\Component\HttpKernel\Attribute\Cache;
Replace ParamConverter
with MapEntity
see:
-use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
+use Symfony\Bridge\Doctrine\Attribute\MapEntity;
// ...
-#[ParamConverter('post', options: ['mapping' => ['postSlug' => 'slug']])]
-public function addComment(Request $request, Post $post): Response
+public function addComment(
+ Request $request,
+ #[MapEntity(mapping: ['postSlug' => 'slug'])] Post $post
+): Response
{
// ...
}
I can pick this up.
TomasVotruba and stephanvierkant
Metadata
Metadata
Assignees
Labels
No labels