Let's look at the Symfony FrameworkBundle extension configuration. Where can we configure them? In
This is how it looks in YAML:
What is the name of the key? Secret, secrets...? We don't know, and we only copy-paste from Symfony Documentation.
So how does this memory-lock change with PHP?
No, we can the code smell is banging us to our eyes:
EntityManagerInterfaceand add use import at the top of the file.
What is the code smell in a config? We don't have to autocomplete for the option name. The option names are always the same, one might say "constant," and can be found in Symfony documentation:
But I don't want to memory 50 words per Symfony config. I want to code ambitious Rector rules that will remove "legacy" from our vocabulary. If only there was something like IDE but for Symfony configs...
Instead of typing strings from the back of your memory, make use of
There is constant class for
Also for Doctrine -
Pretty cool, right? We don't have to care about string and documentation reference because all configuration options are defined in the place we need them. Just in time.
Don't forget to add Amnesia to your project:
compose require symplify/amnesia
And that's it!