Files
piratepoet/mailpoet/lib/Automation/Integrations/MailPoet/Analytics/Analytics.php
David Remer c1692de029 Make analytics endpoint a GET endpoint
[MAILPOET-5088]
2023-06-15 12:25:12 +02:00

27 lines
674 B
PHP

<?php declare(strict_types = 1);
namespace MailPoet\Automation\Integrations\MailPoet\Analytics;
use MailPoet\API\REST\API;
use MailPoet\Automation\Engine\Hooks;
use MailPoet\Automation\Engine\WordPress;
use MailPoet\Automation\Integrations\MailPoet\Analytics\Endpoints\OverviewEndpoint;
class Analytics {
/** @var WordPress */
private $wordPress;
public function __construct(
WordPress $wordPress
) {
$this->wordPress = $wordPress;
}
public function register(): void {
$this->wordPress->addAction(Hooks::API_INITIALIZE, function (API $api) {
$api->registerGetRoute('automation/analytics/overview', OverviewEndpoint::class);
});
}
}