Skip to content

Commit

Permalink
Fix php version & typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony committed Nov 18, 2019
1 parent 0a49925 commit c6039ac
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
5 changes: 3 additions & 2 deletions Handler/GelfHandlerWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
{
Expand Down
9 changes: 7 additions & 2 deletions Processor/ExceptionProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,24 @@
* 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
{
/**
* @return array The processed records
*/
public function __invoke(array $records)
{
if (isset($records['context']['exception']))
{
if (isset($records['context']['exception'])) {
$records['extra']['stacktrace'] = $records['context']['exception']->getTraceAsString();
}

Expand Down
1 change: 1 addition & 0 deletions Tests/Unit/Processor/ExceptionProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 14 additions & 5 deletions Transport/UdpTransportWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -11,6 +12,11 @@
use Gelf\Transport\UdpTransportFactory;
use Magento\Framework\App\Config\ScopeConfigInterface;

/**
* Class UdpTransportWrapper
*
* @package Opengento\Logger\Transport
*/
class UdpTransportWrapper implements TransportInterface
{
/**
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"Elasticsearch"
],
"require": {
"php": ">=7.0",
"php": ">=7.1",
"magento/framework": ">=100.1.0",
"graylog2/gelf-php": "^1.6"
},
Expand Down

0 comments on commit c6039ac

Please sign in to comment.