Commit e813d911 authored by Avris's avatar Avris

v4.0

parent 331d9df0
......@@ -6,7 +6,7 @@ use Avris\Micrus\Bootstrap\EventSubscriberInterface;
use Avris\Micrus\Controller\Http\RequestInterface;
use Avris\Micrus\Tool\Config\ParametersProvider;
class GoogleAnalytics extends \Twig_Extension implements ParametersProvider, EventSubscriberInterface
class GoogleAnalytics extends \Twig_Extension implements EventSubscriberInterface
{
const CODE = <<<HTML
<script>
......@@ -33,16 +33,6 @@ HTML;
$this->trackingId = $config->get('trackingId');
}
/** @return array */
public function getDefaultParameters()
{
return [
'googleAnalytics' => [
'trackingId' => 'GOOGLE_ANALYTICS_TRACKING_ID',
]
];
}
public function getFunctions()
{
return [
......
......@@ -4,8 +4,16 @@ namespace Avris\Micrus\GoogleAnalytics;
use Avris\Micrus\Bootstrap\Module;
use Avris\Micrus\Bootstrap\ModuleInterface;
use Avris\Micrus\Bootstrap\ModuleTrait;
use Avris\Micrus\Tool\Config\ParametersProvider;
class GoogleAnalyticsModule implements ModuleInterface
class GoogleAnalyticsModule implements ModuleInterface, ParametersProvider
{
use ModuleTrait;
public function getParametersDefaults(): array
{
return [
'GA_TRACKING_ID' => 'GOOGLE_ANALYTICS_TRACKING_ID',
];
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment