glewio / glew-magento2-service

GNU General Public License v3.0
3 stars 3 forks source link

Direct use of Object Manager #9

Open mark-gene opened 4 years ago

mark-gene commented 4 years ago

Please change files like Model/Types/Inventory.php to not use the object manager directly. Look to use the DI methods that Magento provides. These should also be built to interfaces to help ensure SOLID code.

kirkmadera commented 4 years ago

Object manager is used in many places throughout code. This is not an isolated issue. Object manager usage breaks dependency injection and makes unit testing and substitution more difficult. This should be replaced with Constructor based dependency injection.