Skip to content
This repository has been archived by the owner on Mar 9, 2023. It is now read-only.

Change inheritance classes to Object composition pattern #6

Open
robin-homberg opened this issue Jul 27, 2018 · 2 comments
Open

Change inheritance classes to Object composition pattern #6

robin-homberg opened this issue Jul 27, 2018 · 2 comments
Labels
backlog backlog enhancement New feature or request

Comments

@robin-homberg
Copy link
Contributor

Describe the bug
There are classes inside the project that are created by class inheritance. While this was an code style mostly used in Magento1, and should'nt still be used in Magento2, the class, and other classes written like this, should be changed to the Object composition pattern.
https://devdocs.magento.com/guides/v2.3/ext-best-practices/extension-coding/common-programming-bp.html#composition-over-inheritance

F.e the Flagbit\Flysystem\Block\Adminhtml\Filesystem\Content\Uploader class should be changed, regarding to this.

@robin-homberg robin-homberg added the bug Something isn't working label Jul 27, 2018
@flagbird
Copy link

flagbird commented Jul 27, 2018

I wouldn't consider this a bug, but an enhancement.

Be aware that, depending on how far this project is used by the community, that removing the inherited class may result in a BC break. Other users of Magento2-Flysystem might use these inherited classes in type hints. Please be sure to use a correct semantic version, if this gets merged.

@robin-homberg robin-homberg added enhancement New feature or request and removed bug Something isn't working labels Jul 27, 2018
@robin-homberg
Copy link
Contributor Author

since this is the only class where "unnesessary" class inheritation is still used and there is a core class (\Magento\Cms\Block\Adminhtml\Wysiwyg\Images\Content\Uploader) which i used as pattern for my class which does it the same way. I'm not anymore sure if this should be changed.

@robin-homberg robin-homberg added the backlog backlog label Apr 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backlog backlog enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants