From c6039acf4722a5430959fc3c93ed99c1ba2c73c1 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 18 Nov 2019 23:13:44 +0100 Subject: [PATCH] Fix php version & typos --- Handler/GelfHandlerWrapper.php | 5 +++-- Processor/ExceptionProcessor.php | 9 +++++++-- .../Unit/Processor/ExceptionProcessorTest.php | 1 + Transport/UdpTransportWrapper.php | 19 ++++++++++++++----- composer.json | 2 +- 5 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Handler/GelfHandlerWrapper.php b/Handler/GelfHandlerWrapper.php index 3ba8e98..9c1422b 100644 --- a/Handler/GelfHandlerWrapper.php +++ b/Handler/GelfHandlerWrapper.php @@ -3,6 +3,7 @@ * Copyright © OpenGento, All rights reserved. * See LICENSE bundled with this library for license details. */ + namespace Opengento\Logger\Handler; use Gelf\PublisherInterface; @@ -21,8 +22,8 @@ class GelfHandlerWrapper extends GelfHandler * GelfHandlerWrapper constructor. * * @param PublisherInterface $publisher - * @param int $level - * @param bool $bubble + * @param int $level + * @param bool $bubble */ public function __construct(PublisherInterface $publisher, $level = Logger::DEBUG, $bubble = true) { diff --git a/Processor/ExceptionProcessor.php b/Processor/ExceptionProcessor.php index ff1c90e..ac80796 100644 --- a/Processor/ExceptionProcessor.php +++ b/Processor/ExceptionProcessor.php @@ -3,10 +3,16 @@ * Copyright © OpenGento, All rights reserved. * See LICENSE bundled with this library for license details. */ + namespace Opengento\Logger\Processor; use Monolog\Processor\ProcessorInterface; +/** + * Class ExceptionProcessor + * + * @package Opengento\Logger\Processor + */ class ExceptionProcessor implements ProcessorInterface { /** @@ -14,8 +20,7 @@ class ExceptionProcessor implements ProcessorInterface */ public function __invoke(array $records) { - if (isset($records['context']['exception'])) - { + if (isset($records['context']['exception'])) { $records['extra']['stacktrace'] = $records['context']['exception']->getTraceAsString(); } diff --git a/Tests/Unit/Processor/ExceptionProcessorTest.php b/Tests/Unit/Processor/ExceptionProcessorTest.php index 60b124f..fdca95b 100644 --- a/Tests/Unit/Processor/ExceptionProcessorTest.php +++ b/Tests/Unit/Processor/ExceptionProcessorTest.php @@ -3,6 +3,7 @@ * Copyright © OpenGento, All rights reserved. * See LICENSE bundled with this library for license details. */ + namespace Opengento\Logger\Tests\Unit\Processor; use Opengento\Logger\Processor\ExceptionProcessor; diff --git a/Transport/UdpTransportWrapper.php b/Transport/UdpTransportWrapper.php index 4afc008..3cb7f06 100644 --- a/Transport/UdpTransportWrapper.php +++ b/Transport/UdpTransportWrapper.php @@ -3,6 +3,7 @@ * Copyright © OpenGento, All rights reserved. * See LICENSE bundled with this library for license details. */ + namespace Opengento\Logger\Transport; use Gelf\MessageInterface as Message; @@ -11,6 +12,11 @@ use Gelf\Transport\UdpTransportFactory; use Magento\Framework\App\Config\ScopeConfigInterface; +/** + * Class UdpTransportWrapper + * + * @package Opengento\Logger\Transport + */ class UdpTransportWrapper implements TransportInterface { /** @@ -62,17 +68,20 @@ public function __construct( */ public function send(Message $message) { - return $this->getTransporter()->send($message); + return $this->getTransporter()->send($message); } + /** + * @return UdpTransport + */ private function getTransporter(): UdpTransport { if (null === $this->transporter) { $this->transporter = $this->transportFactory->create([ - 'host'=> $this->scopeConfig->getValue($this->hostPath), - 'port' => $this->scopeConfig->getValue($this->portPath), - 'chunkSize' => $this->chunkSize] - ); + 'host' => $this->scopeConfig->getValue($this->hostPath), + 'port' => $this->scopeConfig->getValue($this->portPath), + 'chunkSize' => $this->chunkSize + ]); } return $this->transporter; diff --git a/composer.json b/composer.json index a246818..0246278 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ "Elasticsearch" ], "require": { - "php": ">=7.0", + "php": ">=7.1", "magento/framework": ">=100.1.0", "graylog2/gelf-php": "^1.6" },