Skip to content

Commit

Permalink
Changed constructor to use an interface
Browse files Browse the repository at this point in the history
The front controller only accepts an HTTP response object. The front controller now has a direct dependency on the Response\Http class, which is not correct. The front controller should not care which response object will be injected only that it will adhire the ResponseInterface. So changed this constructor to accept a ResponseInterface which in di.xml is being replaced by the Response\Http class.
  • Loading branch information
dverkade committed Oct 26, 2016
1 parent bd1655b commit c05293c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/internal/Magento/Framework/App/FrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ class FrontController implements FrontControllerInterface
protected $_routerList;

/**
* @var \Magento\Framework\App\Response\Http
* @var \Magento\Framework\App\ResponseInterface
*/
protected $response;

/**
* @param RouterList $routerList
* @param \Magento\Framework\App\Response\Http $response
* @param \Magento\Framework\App\ResponseInterface $response
*/
public function __construct(
RouterList $routerList,
\Magento\Framework\App\Response\Http $response
\Magento\Framework\App\ResponseInterface $response
) {
$this->_routerList = $routerList;
$this->response = $response;
Expand Down

0 comments on commit c05293c

Please sign in to comment.