New directory structure • Less depth, easier to navigate • Non-PHP files in their own directories (assets/, templates/) • Decoupled from Symfony (assets/, src/, templates/, public/)
Aliases • Shortcuts for common packages (log, behat, phpunit, …) • Optimized for Symfony Components (no need to use the symfony/ prefix, just workflow, dom-crawler, …) • Opinionated choices (admin, api, orm, mailer, …)
Adding a Twig Extension Where do I store the Twig extension class? Which file do I need to change to register it? Which tag do I need to use? How do I declare a tag in YAML? Which interface/class do I need to implement/ extend? It’s too complex. What about doing it the dirty way and do it in the controller instead? hmm, ok
Symfony 4 with Flex recap • Auto-configuration for any Composer package • A new Maker bundle to simplify creating files • Support for Flex private repositories • No more boilerplate code, just business logic • Controllers and commands are services now • From micro to monolith • Meta-packages doing a lot for you out of the box Productivity boost! Better DX
More with Symfony 4 • Dependency injection without thinking about it • API Platform, the most advanced API system • Admin, simple and powerful • Symfony Encore, makes working with Webpack enjoyable Talk at Cluj! Talk at Cluj! Talk at Cluj!
More with Symfony 4 HTTP2 push support Inject secrets as parameters (Docker/K8s) Built-in PSR-3 logger Env vars where it makes sense DI simplified, classes as IDs PSR-11, PSR-6, PSR-16 out of the box Private services by default
symfony/symfony as a dep • Won’t be enforced • But strongly not recommended • Won’t be removed as still the best way to manage the project Use explicit dependencies
No longer recommended • Symfony Standard Edition (EOL nov 2020) • Symfony Installer (EOL nov 2020) • symfony/symfony as a Composer dep (EOL nov 2020) • Silex (EOL june 2018) • symfony 1 (EOL dec 2017)