Inject dateBlock to services which use it

[MAILPOET-2665]
This commit is contained in:
Rostislav Wolny
2020-01-30 11:01:28 +01:00
committed by Jack Kitterhing
parent 6827eb93e6
commit dc5a296133
6 changed files with 39 additions and 15 deletions

View File

@@ -27,11 +27,21 @@ class Subscribers {
/** @var WPFunctions */
private $wp;
public function __construct(PageRenderer $pageRenderer, PageLimit $listingPageLimit, SubscribersFeature $subscribersFeature, WPFunctions $wp) {
/** @var Block\Date */
private $dateBlock;
public function __construct(
PageRenderer $pageRenderer,
PageLimit $listingPageLimit,
SubscribersFeature $subscribersFeature,
WPFunctions $wp,
Block\Date $dateBlock
) {
$this->pageRenderer = $pageRenderer;
$this->listingPageLimit = $listingPageLimit;
$this->subscribersFeature = $subscribersFeature;
$this->wp = $wp;
$this->dateBlock = $dateBlock;
}
public function render() {
@@ -59,8 +69,8 @@ class Subscribers {
return $field;
}, CustomField::findArray());
$data['date_formats'] = Block\Date::getDateFormats();
$data['month_names'] = Block\Date::getMonthNames();
$data['date_formats'] = $this->dateBlock->getDateFormats();
$data['month_names'] = $this->dateBlock->getMonthNames();
$data['premium_plugin_active'] = License::getLicense();
$data['mss_active'] = Bridge::isMPSendingServiceEnabled();