From 675f2bf48ac2205bfc1ba7d9d440a209dd3ece25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 28 Oct 2024 17:40:45 +0100 Subject: [PATCH 1/2] Add some type hint for SF 6+ --- src/OkvpnDatadogBundle.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OkvpnDatadogBundle.php b/src/OkvpnDatadogBundle.php index 68cead0..1c60d68 100644 --- a/src/OkvpnDatadogBundle.php +++ b/src/OkvpnDatadogBundle.php @@ -24,7 +24,7 @@ public function __construct() /** * {@inheritdoc} */ - public function boot() + public function boot(): void { if (null === $this->startTime) { $this->startTime = microtime(true); @@ -34,7 +34,7 @@ public function boot() /** * {@inheritdoc} */ - public function shutdown() + public function shutdown(): void { $this->startTime = null; } @@ -42,7 +42,7 @@ public function shutdown() /** * {@inheritdoc} */ - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { $container->addCompilerPass(new SqlLoggerPass(['default'])); $container->addCompilerPass(new PushDatadogHandlerPass()); From 5b308a3818d46b019afb60b68b5fac6274dcb640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 28 Oct 2024 17:43:54 +0100 Subject: [PATCH 2/2] Add some type hint for statsd --- src/Client/ClientWrapper.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Client/ClientWrapper.php b/src/Client/ClientWrapper.php index d38ed2b..0a2e87b 100644 --- a/src/Client/ClientWrapper.php +++ b/src/Client/ClientWrapper.php @@ -36,7 +36,7 @@ public function __construct(LoggerInterface $logger = null, ?string $instanceId /** * {@inheritdoc} */ - public function configure(array $options = []) + public function configure(array $options = []): Client { $this->options = $options; return parent::configure($options); @@ -45,7 +45,7 @@ public function configure(array $options = []) /** * {@inheritdoc} */ - public function event($title, $text, array $metadata = [], array $tags = []) + public function event($title, $text, array $metadata = [], array $tags = []): Client { if (!$this->dataDog) { return $this; @@ -97,7 +97,7 @@ public function getOptions(): array /** * {@inheritdoc} */ - protected function sendMessages(array $messages) + protected function sendMessages(array $messages): Client { if ($this->repeatCount >= self::MAX_REPEAT_COUNT) { return false;