Being "PSR-4 compatible" means that the full qualified name of a class is equal to its directory and file name. For example, the file …/Wikibase/client/includes/Api/ApiClientInfo.php contains the class \Wikibase\Client\Api\ApiClientInfo. The mapping for this can be found in Wikibase.git's extension-*-wip.json files in the "AutoloadNamespaces" section: "Wikibase\\Client\\Api\\": "client/includes/Api/" and so on.
Even if most classes in the Wikibase.git code base are already PSR-4 compatible, some are not, which is the reason why there are still such long autoload.php files.
The goal of this ticket is to get rid of the autoload.php files and the build/generateAutoload.php script generating them.
- This ticket is not about the components in the vendor directory (DataValues, Wikibase-DataModel and so on). Changing these is more troublesome because it usually means a breaking release of the component must be made. This is barely worth the trouble.
- It might not be possible to make the maintenance directories PSR-4 compatible, because the file names must follow the naming scheme of maintenance scripts, and can not be made equal to the class name in these file.
- I suggest to create a chain of small patches, each one only touching a single directory, or even a single class if it happens to be used a lot. This makes reviewing much easier.
- You must make sure other code repositories that use Wikibase.git classes are updated when you change the namespace of a class. Use MediaWiki code search for this.