Description
Summary (*)
I was trying to fix the issue mentioned in #12362, by injecting an updated version of SessionManager to replace the original Magento\Framework\Session\SessionManager, on a Magento 2.2.5. After a while, I managed to find a few exceptions being thrown around by some of the third-party modules I have previously installed. The main problem here is that some of the classes in those modules have directly included "Magento\Framework\Session\SessionManager" in the constructor (instead of Magento\Framework\Session\SessionManagerInterface). I was worried if the replacement would cause similar problems elsewhere in the system, so I have done a few greps to look for classes having the SessionManager directly injected into their constructors, and I managed to find a few of them in the core codepool, namely Paypal\Controller\Transparent\RequestSecureToken and Magento\Framework\View\Context.
I am not quite sure why it is so, but it seems to me the interface should be used instead.
Examples (*)
I don't really have an example here.
Proposed solution
To change Magento\Framework\Session\SessionManager to Magento\Framework\Session\SessionManagerInterface
In
- Magento/Authorizenet/Model/Directpost/Session.php
- Magento/Customer/CustomerData/Plugin/SessionChecker.php
- Magento/Paypal/Controller/Transparent/RequestSecureToken.php
- lib/internal/Magento/Framework/View/Context.php