Skip to content

Commit

Permalink
ENGCOM-7005: Removed redundant method _beforeToHtml #27057
Browse files Browse the repository at this point in the history
  • Loading branch information
VladimirZaets committed Mar 2, 2020
2 parents 56b0353 + 5115af3 commit 4d8af02
Showing 1 changed file with 12 additions and 17 deletions.
29 changes: 12 additions & 17 deletions app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@
*/
namespace Magento\Newsletter\Block\Adminhtml;

use Magento\Backend\Block\Template;
use Magento\Backend\Block\Template\Context;
use Magento\Newsletter\Model\ResourceModel\Queue\Collection;
use Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory;

/**
* Newsletter Subscriber block
*
* @api
* @since 100.0.2
*/
class Subscriber extends \Magento\Backend\Block\Template
class Subscriber extends Template
{
/**
* Queue collection
Expand All @@ -32,34 +37,24 @@ class Subscriber extends \Magento\Backend\Block\Template
protected $_template = 'Magento_Newsletter::subscriber/list.phtml';

/**
* @var \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory
* @var CollectionFactory
*/
protected $_collectionFactory;

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $collectionFactory
* @param Context $context
* @param CollectionFactory $collectionFactory
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Newsletter\Model\ResourceModel\Queue\CollectionFactory $collectionFactory,
Context $context,
CollectionFactory $collectionFactory,
array $data = []
) {
$this->_collectionFactory = $collectionFactory;
parent::__construct($context, $data);
}

/**
* Prepares block to render
*
* @return $this
*/
protected function _beforeToHtml()
{
return parent::_beforeToHtml();
}

/**
* Return queue collection with loaded neversent queues
*
Expand All @@ -68,7 +63,7 @@ protected function _beforeToHtml()
public function getQueueCollection()
{
if ($this->_queueCollection === null) {
/** @var $this->_queueCollection \Magento\Newsletter\Model\ResourceModel\Queue\Collection */
/** @var $this->_queueCollection Collection */
$this->_queueCollection = $this
->_collectionFactory
->create()
Expand Down

0 comments on commit 4d8af02

Please sign in to comment.