Category: annotations

Symfony 5 @required annotation weird caching issue during setter injection?

I discovered this strange issue in Symfony 5 which I believe is connected to docker and Symfony itself. MY SETUP docker-compose.yml version: ‘3.7’ services: webapp: build: context: ./php/ dockerfile: Dockerfile container_name: webapp image: php:7.4.1-fpm-alpine volumes: – ../:/srv/app apache2: build: network:…

Symfony 5 : @IsGranted on method annotation doesn’t work on inherited role

I (obviously) searched for similar problems, but mine ain’t none of them. Here’s my case : I made a custom role : ROLE_SUPER_ADMIN My actual user is admin, his only role is ROLE_SUPER_ADMIN The role ROLE_SUPER_ADMIN inherits the ROLE_ADMIN (see…

Symfony Nelmio Framework Extra Bundle cache config by notation is being override on browser

When I set cache by notation on any controller of my symfony proyect: /** * @Cache(smaxage=”301″, maxage=”300″, public=true) */ public function fooAction(Request $request) { […] } max-age and public options are override when they reach the browser: Response headers Cache-Control:…

Can i use Symfony’s Route Annotation in Non-Symfony Project

I already tried things here https://symfony.com/doc/master/components/routing.html But i couldn’t make it. <?php use DoctrineCommonAnnotationsAnnotationReader; use SymfonyBundleFrameworkBundleRoutingAnnotatedRouteControllerLoader; use SymfonyComponentConfigFileLocator; use SymfonyComponentRoutingLoaderAnnotationDirectoryLoader; use ComposerAutoloadClassLoader; use DoctrineCommonAnnotationsAnnotationRegistry; /** @var ClassLoader $loader */ $loader = require __DIR__.’/vendor/autoload.php’; AnnotationRegistry::registerLoader([$loader, ‘loadClass’]); $loader = new AnnotationDirectoryLoader( new…