-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule: Check Module file structure #30
Comments
Thanks for bringing this up. I generally agree that we should check for expected folder structure. I however would like to include a discussion (including with Magento) what this folder structure should be in the first place. In particular should Magento go its own way (again) or should it follow where PHP as a whole seems to be heading. For example: On structuring PHP projects and php-pds One issue which I think is currently insufficiently catered for is the question how are tests distributed in a standardised way. The current Test folder covers unit tests but there is no established way on how to for example distribute integration and functional tests (this will be important for the new MFTF tests as well). |
+1 for php-pds. We should not enforce the same standards for extensions as for core modules, those have different needs. Although in an ideal world, we'd have really modular core modules that could follow php-pds as well. |
@fooman the article also brings up a good point: "group by archetype" vs. "group by feature": Magento still follows the "group by archetype" pattern, just added more archetypes in Magento 2 (e.g. Api, Observer, Plugin). But other than in Magento 1, we are free to arrange our namespaces as we like, without constraints from the framework and I would not blindly follow the core here, which is not even consistent. I'd love to see our own reasonable guidelines for namespacing, though. This will need more discussion |
And one my favorite topics: framework independent domain code. I'd hate cramming this into |
Even this documentation is remarkably vague:
|
A typical file structure for a Magento 2 module shoul look like the following:
For this reason, we a should add a warning if in main an unexpected dir.
Expected dirs:
Dokumentation:
https://devdocs.magento.com/guides/v2.2/extension-dev-guide/build/module-file-structure.html
The text was updated successfully, but these errors were encountered: