When this bundle is installed and enabled it will make sure all your annotation metadata is cached when your container dependency container is built.
We also provide a command to validate that all annotations are properly loaded.
composer require happyr/annotation-warmer
We warm upp all classes in src
by default. You may use a different configuration of paths if you like:
happyr_annotation_warmer:
paths:
- '%kernel.project_dir%/src/Message/Command'
- '%kernel.project_dir%/src/Message/Event'
To make sure your annotations are properly configured you may run the lint command:
bin/console lint:annotations
- We assume that the classes in the specified paths are using PSR-4.
- We also assume that all
*.php
files in the path has a class with the same as the filename.
We are only warming cache for annotations to the Serializer and Validation component.