Skip to content

Commit

Permalink
magento/magenot2#15588: add dependency in a backwards compatible way
Browse files Browse the repository at this point in the history
  • Loading branch information
dmanners authored and mage2pratik committed Jul 14, 2018
1 parent 25010d4 commit 65ccd39
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

use Magento\Backend\App\Action;
use Magento\Store\Model\App\Emulation;
use Magento\Framework\App\ObjectManager;

class Generate extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
{
Expand All @@ -17,16 +18,15 @@ class Generate extends \Magento\Sitemap\Controller\Adminhtml\Sitemap
/**
* Generate constructor.
* @param Action\Context $context
* @param \Magento\Store\Model\App\Emulation $appEmulation
* @param \Magento\Store\Model\App\Emulation|null $appEmulation
*/
public function __construct(
Action\Context $context,
Emulation $appEmulation
Emulation $appEmulation = null
) {
$this->appEmulation = $appEmulation;
parent::__construct(
$context
);
parent::__construct($context);
$this->appEmulation = $appEmulation ?: ObjectManager::getInstance()
->get(\Magento\Store\Model\App\Emulation::class);
}

/**
Expand Down

0 comments on commit 65ccd39

Please sign in to comment.