You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 27, 2020. It is now read-only.
minor #1048 Improve PSR-4 autoloading by default (Pierstoval)
This PR was merged into the 2.7 branch.
Discussion
----------
Improve PSR-4 autoloading by default
TL;DR: (updated Marth 3rd)
Before, I proposed to use any optimization by default in `composer.json` (complementary to PSR-4 autoload for the AppBundle).
I took note of the different arguments and removed loaders optimization because it is not suitable for dev environments, but kept AppBundle PSR-4 explicit load because it encourages PSR-4 best practices of autoload.
---
As seen on symfony/demo#490 (and it's certainly a well-known issue for developers using PHP Inspections EA Extended plugin for PHPStorm), having empty namespaces in `psr-4` rules has an impact on performances.
Using this by default on the Standard Edition may encourage developers to add PSR-4 rules if they create new namespaces (for example if they want to create bundleless apps or other bundles, or components inside the same app, etc.).
What do you think about putting this in the SE?
Also, for best autoloading performances, it is recommended to use `classmap-authoritative` options (which adds `optimize-autoloader` implicitly). I added it in the `composer.json` but I'm not sure whether it's the best option to propose to Symfony newcomers (because `composer install` and `update` takes more time to execute).
For this have a question: should we recommend `classmap-authoritative` or `optimize-autoloader` (or nothing ❔) by default ?
Commits
-------
5f7ef8c Improve PSR-4 autoload by default
0 commit comments