Server IP : 172.67.158.161 / Your IP : 52.15.224.97 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/root/proc/thread-self/root/proc/self/root/proc/self/root/proc/thread-self/root/home/giankuin/thietke365.net/wp-content/plugins/mailpoet/lib/Twig/ |
Upload File : |
<?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing namespace MailPoet\Twig; if (!defined('ABSPATH')) exit; use MailPoet\Analytics\Analytics as AnalyticsGenerator; use MailPoet\DI\ContainerWrapper; use MailPoet\InvalidStateException; use MailPoetVendor\Twig\Extension\AbstractExtension; use MailPoetVendor\Twig\TwigFunction; class Analytics extends AbstractExtension { /** @var AnalyticsGenerator */ private $analytics; public function getFunctions() { return [ new TwigFunction( 'get_analytics_data', [$this, 'generateAnalytics'], ['is_safe' => ['all']] ), new TwigFunction( 'is_analytics_enabled', [$this, 'isEnabled'], ['is_safe' => ['all']] ), new TwigFunction( 'get_analytics_public_id', [$this, 'getPublicId'], ['is_safe' => ['all']] ), new TwigFunction( 'is_analytics_public_id_new', [$this, 'isPublicIdNew'], ['is_safe' => ['all']] ), ]; } private function getAnalytics() { if ($this->analytics === null) { $this->analytics = ContainerWrapper::getInstance()->get(AnalyticsGenerator::class); } if (!$this->analytics instanceof AnalyticsGenerator) { throw new InvalidStateException('AnalyticsGenerator service was not registered!'); } return $this->analytics; } public function generateAnalytics() { return $this->getAnalytics()->generateAnalytics(); } public function isEnabled() { return $this->getAnalytics()->isEnabled(); } public function getPublicId() { return $this->getAnalytics()->getPublicId(); } public function isPublicIdNew() { return $this->getAnalytics()->isPublicIdNew(); } }