magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

\Magento\Framework\Pricing\PriceCurrencyInterface depends on Magento application code

Open joshdifabio opened this issue 12 years ago • 5 comments

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.

joshdifabio avatar Oct 06 '14 09:10 joshdifabio

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.

maksek avatar Oct 21 '14 00:10 maksek

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.

alankent avatar Oct 29 '14 22:10 alankent

Hi @joshdifabio, we are currently working on the issue. Fix will be delivered in upcoming update.

mcspronko avatar Nov 14 '14 08:11 mcspronko

Ticket: MAGETWO-30415. It is fixed and will be delivered in one of the next updates.

vpelipenko avatar Jan 15 '15 09:01 vpelipenko

This issue is fixed and available in 0.42.0-beta5.

vpelipenko avatar Jan 23 '15 21:01 vpelipenko