\Magento\Framework\Pricing\PriceCurrencyInterface depends on Magento application code
Currently, \Magento\Framework\Pricing\PriceCurrencyInterface depends on:
- \Magento\Store\Model\Store
- \Magento\Directory\Model\Currency
Is it intended for PriceCurrencyInterface, which is part of the framework, to depend on application classes?
Furthermore, shouldn't those dependencies be on interfaces instead of on concrete implementations?
The functionality provided by this interface is very much coupled to Magento's application code (it's only real purpose seems to be to simplify working with a Store object, such that the consumer doesn't have to extract configuration from the Store object); as such it seems wrong for the interface to live in \Magento\Framework.
Apologies if this has already been covered.
Hi @joshdifabio, thanks for taking time and looking into code. We are going to reduce dependencies in further milestones. Moreover we are going to provide full set of interfaces for modules, see upcoming updates.
Just to add to your question of "is this wrong"? You are absolutely correct. Magento\Framework should not depend on modules directly. Interfaces are fine with modules implementing the interfaces, but not modules directly.
Hi @joshdifabio, we are currently working on the issue. Fix will be delivered in upcoming update.
Ticket: MAGETWO-30415. It is fixed and will be delivered in one of the next updates.
This issue is fixed and available in 0.42.0-beta5.