Jordi Boggiano 4 лет назад
Родитель
Сommit
4ef5da80ad

+ 1 - 1
src/Monolog/Formatter/ElasticaFormatter.php

@@ -77,7 +77,7 @@ class ElasticaFormatter extends NormalizerFormatter
     {
         $document = new Document();
         $document->setData($record);
-        if(method_exists($document, 'setType')) {
+        if (method_exists($document, 'setType')) {
             $document->setType($this->type);
         }
         $document->setIndex($this->index);

+ 2 - 2
src/Monolog/Formatter/MongoDBFormatter.php

@@ -66,7 +66,7 @@ class MongoDBFormatter implements FormatterInterface
     }
 
     /**
-     * @param mixed[] $array
+     * @param  mixed[]        $array
      * @return mixed[]|string Array except when max nesting level is reached then a string "[...]"
      */
     protected function formatArray(array $array, int $nestingLevel = 0)
@@ -91,7 +91,7 @@ class MongoDBFormatter implements FormatterInterface
     }
 
     /**
-     * @param mixed $value
+     * @param  mixed          $value
      * @return mixed[]|string
      */
     protected function formatObject($value, int $nestingLevel)

+ 1 - 1
src/Monolog/Formatter/NormalizerFormatter.php

@@ -122,7 +122,7 @@ class NormalizerFormatter implements FormatterInterface
     }
 
     /**
-     * @param  mixed                      $data
+     * @param  mixed                $data
      * @return scalar|array<scalar>
      */
     protected function normalize($data, int $depth = 0)

+ 1 - 1
src/Monolog/Formatter/ScalarFormatter.php

@@ -34,7 +34,7 @@ class ScalarFormatter extends NormalizerFormatter
     }
 
     /**
-     * @param  mixed $value
+     * @param  mixed                $value
      * @return string|int|bool|null
      */
     protected function normalizeValue($value)

+ 1 - 1
src/Monolog/Handler/BrowserConsoleHandler.php

@@ -213,7 +213,7 @@ class BrowserConsoleHandler extends AbstractProcessingHandler
     }
 
     /**
-     * @param mixed[] $dict
+     * @param  mixed[] $dict
      * @return mixed[]
      */
     private static function dump(string $title, array $dict): array

+ 1 - 1
src/Monolog/Handler/DynamoDbHandler.php

@@ -84,7 +84,7 @@ class DynamoDbHandler extends AbstractProcessingHandler
     }
 
     /**
-     * @param mixed[] $record
+     * @param  mixed[] $record
      * @return mixed[]
      */
     protected function filterEmptyFields(array $record): array

+ 2 - 2
src/Monolog/Handler/ElasticaHandler.php

@@ -47,8 +47,8 @@ class ElasticaHandler extends AbstractProcessingHandler
     protected $options = [];
 
     /**
-     * @param Client     $client  Elastica Client object
-     * @param mixed[]    $options Handler configuration
+     * @param Client  $client  Elastica Client object
+     * @param mixed[] $options Handler configuration
      */
     public function __construct(Client $client, array $options = [], $level = Logger::DEBUG, bool $bubble = true)
     {

+ 2 - 2
src/Monolog/Handler/ElasticsearchHandler.php

@@ -54,8 +54,8 @@ class ElasticsearchHandler extends AbstractProcessingHandler
     protected $options = [];
 
     /**
-     * @param Client     $client  Elasticsearch Client object
-     * @param mixed[]    $options Handler configuration
+     * @param Client  $client  Elasticsearch Client object
+     * @param mixed[] $options Handler configuration
      */
     public function __construct(Client $client, array $options = [], $level = Logger::DEBUG, bool $bubble = true)
     {

+ 2 - 2
src/Monolog/Handler/ErrorLogHandler.php

@@ -31,8 +31,8 @@ class ErrorLogHandler extends AbstractProcessingHandler
     protected $expandNewlines;
 
     /**
-     * @param int        $messageType    Says where the error should go.
-     * @param bool       $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
+     * @param int  $messageType    Says where the error should go.
+     * @param bool $expandNewlines If set to true, newlines in the message will be expanded to be take multiple log entries
      */
     public function __construct(int $messageType = self::OPERATING_SYSTEM, $level = Logger::DEBUG, bool $bubble = true, bool $expandNewlines = false)
     {

+ 3 - 2
src/Monolog/Handler/FirePHPHandler.php

@@ -63,8 +63,9 @@ class FirePHPHandler extends AbstractProcessingHandler
     /**
      * Base header creation function used by init headers & record headers
      *
-     * @param  array<int|string>     $meta    Wildfire Plugin, Protocol & Structure Indexes
-     * @param  string                $message Log message
+     * @param array<int|string> $meta    Wildfire Plugin, Protocol & Structure Indexes
+     * @param string            $message Log message
+     *
      * @return array<string, string> Complete header string ready for the client as key and message as value
      */
     protected function createHeader(array $meta, string $message): array

+ 2 - 2
src/Monolog/Handler/IFTTTHandler.php

@@ -33,8 +33,8 @@ class IFTTTHandler extends AbstractProcessingHandler
     private $secretKey;
 
     /**
-     * @param string     $eventName The name of the IFTTT Maker event that should be triggered
-     * @param string     $secretKey A valid IFTTT secret key
+     * @param string $eventName The name of the IFTTT Maker event that should be triggered
+     * @param string $secretKey A valid IFTTT secret key
      */
     public function __construct(string $eventName, string $secretKey, $level = Logger::ERROR, bool $bubble = true)
     {

+ 1 - 1
src/Monolog/Handler/LogglyHandler.php

@@ -44,7 +44,7 @@ class LogglyHandler extends AbstractProcessingHandler
     protected $tag = [];
 
     /**
-     * @param string     $token  API token supplied by Loggly
+     * @param string $token API token supplied by Loggly
      *
      * @throws MissingExtensionException If the curl extension is missing
      */

+ 3 - 3
src/Monolog/Handler/NativeMailerHandler.php

@@ -66,9 +66,9 @@ class NativeMailerHandler extends MailHandler
 
     /**
      * @param string|string[] $to             The receiver of the mail
-     * @param string       $subject        The subject of the mail
-     * @param string       $from           The sender of the mail
-     * @param int          $maxColumnWidth The maximum column width that the message lines will have
+     * @param string          $subject        The subject of the mail
+     * @param string          $from           The sender of the mail
+     * @param int             $maxColumnWidth The maximum column width that the message lines will have
      */
     public function __construct($to, string $subject, string $from, $level = Logger::ERROR, bool $bubble = true, int $maxColumnWidth = 70)
     {

+ 1 - 0
src/Monolog/Handler/PHPConsoleHandler.php

@@ -86,6 +86,7 @@ class PHPConsoleHandler extends AbstractProcessingHandler
 
     /**
      * @param array<string, mixed> $options
+     *
      * @return array<string, mixed>
      */
     private function initOptions(array $options): array

+ 1 - 1
src/Monolog/Handler/ProcessableHandlerInterface.php

@@ -37,7 +37,7 @@ interface ProcessableHandlerInterface
      *
      * @psalm-return ProcessorInterface|callable(Record): Record $callback
      *
-     * @throws \LogicException In case the processor stack is empty
+     * @throws \LogicException             In case the processor stack is empty
      * @return callable|ProcessorInterface
      */
     public function popProcessor(): callable;

+ 2 - 2
src/Monolog/Handler/RedisPubSubHandler.php

@@ -34,8 +34,8 @@ class RedisPubSubHandler extends AbstractProcessingHandler
     private $channelKey;
 
     /**
-     * @param \Predis\Client|\Redis $redis  The redis instance
-     * @param string                $key    The channel key to publish records to
+     * @param \Predis\Client|\Redis $redis The redis instance
+     * @param string                $key   The channel key to publish records to
      */
     public function __construct($redis, string $key, $level = Logger::DEBUG, bool $bubble = true)
     {

+ 3 - 0
src/Monolog/Handler/Slack/SlackRecord.php

@@ -316,6 +316,7 @@ class SlackRecord
      * Generates attachment field
      *
      * @param string|mixed[] $value
+     *
      * @return array{title: string, value: string, short: false}
      */
     private function generateAttachmentField(string $title, $value): array
@@ -335,6 +336,7 @@ class SlackRecord
      * Generates a collection of attachment fields from array
      *
      * @param mixed[] $data
+     *
      * @return array<array{title: string, value: string, short: false}>
      */
     private function generateAttachmentFields(array $data): array
@@ -351,6 +353,7 @@ class SlackRecord
      * Get a copy of record with fields excluded according to $this->excludeFields
      *
      * @phpstan-param FormattedRecord $record
+     *
      * @return mixed[]
      */
     private function removeExcludedFields(array $record): array

+ 1 - 1
src/Monolog/Handler/SyslogUdpHandler.php

@@ -79,7 +79,7 @@ class SyslogUdpHandler extends AbstractSyslogHandler
     }
 
     /**
-     * @param string|string[] $message
+     * @param  string|string[] $message
      * @return string[]
      */
     private function splitMessageIntoLines($message): array

+ 4 - 1
src/Monolog/Handler/TelegramBotHandler.php

@@ -38,7 +38,7 @@ class TelegramBotHandler extends AbstractProcessingHandler
     private const AVAILABLE_PARSE_MODES = [
         'HTML',
         'MarkdownV2',
-        'Markdown' // legacy mode without underline and strikethrough, use MarkdownV2 instead
+        'Markdown', // legacy mode without underline and strikethrough, use MarkdownV2 instead
     ];
 
     /**
@@ -104,18 +104,21 @@ class TelegramBotHandler extends AbstractProcessingHandler
         }
 
         $this->parseMode = $parseMode;
+
         return $this;
     }
 
     public function disableWebPagePreview(bool $disableWebPagePreview = null): self
     {
         $this->disableWebPagePreview = $disableWebPagePreview;
+
         return $this;
     }
 
     public function disableNotification(bool $disableNotification = null): self
     {
         $this->disableNotification = $disableNotification;
+
         return $this;
     }
 

+ 3 - 3
src/Monolog/Handler/TestHandler.php

@@ -172,7 +172,7 @@ class TestHandler extends AbstractProcessingHandler
     }
 
     /**
-     * @param string|int $level Logging level value or name
+     * @param  string|int $level Logging level value or name
      * @return bool
      *
      * @psalm-param callable(Record, int): mixed $predicate
@@ -205,8 +205,8 @@ class TestHandler extends AbstractProcessingHandler
     }
 
     /**
-     * @param string $method
-     * @param mixed[] $args
+     * @param  string  $method
+     * @param  mixed[] $args
      * @return bool
      */
     public function __call($method, $args)

+ 1 - 1
src/Monolog/Processor/WebProcessor.php

@@ -93,7 +93,7 @@ class WebProcessor implements ProcessorInterface
     }
 
     /**
-     * @param mixed[] $extra
+     * @param  mixed[] $extra
      * @return mixed[]
      */
     private function appendExtraFields(array $extra): array

+ 4 - 4
src/Monolog/SignalHandler.php

@@ -41,10 +41,10 @@ class SignalHandler
     }
 
     /**
-     * @param int|string $level Level or level name
-     * @param bool      $callPrevious
-     * @param bool      $restartSyscalls
-     * @param bool|null $async
+     * @param  int|string $level           Level or level name
+     * @param  bool       $callPrevious
+     * @param  bool       $restartSyscalls
+     * @param  bool|null  $async
      * @return $this
      *
      * @phpstan-param Level|LevelName|LogLevel::* $level

+ 1 - 1
tests/Monolog/Formatter/ElasticaFormatterTest.php

@@ -56,7 +56,7 @@ class ElasticaFormatterTest extends \PHPUnit\Framework\TestCase
 
         // Document parameters
         $this->assertEquals('my_index', $doc->getIndex());
-        if(method_exists($doc, 'getType')) {
+        if (method_exists($doc, 'getType')) {
             $this->assertEquals('doc_type', $doc->getType());
         }
 

+ 4 - 5
tests/Monolog/Handler/ElasticaHandlerTest.php

@@ -263,7 +263,6 @@ class ElasticaHandlerTest extends TestCase
         $client->request("/{$this->options['index']}", Request::DELETE);
     }
 
-
     /**
      * Return last created document id from ES response
      * @param  Response    $response Elastica Response object
@@ -279,15 +278,15 @@ class ElasticaHandlerTest extends TestCase
 
     /**
      * Retrieve document by id from Elasticsearch
-     * @param  Client $client     Elastica client
-     * @param  string $index
+     * @param  Client  $client     Elastica client
+     * @param  string  $index
      * @param  ?string $type
-     * @param  string $documentId
+     * @param  string  $documentId
      * @return array
      */
     protected function getDocSourceFromElastic(Client $client, $index, $type, $documentId)
     {
-        if($type === null) {
+        if ($type === null) {
             $path  = "/{$index}/_doc/{$documentId}";
         } else {
             $path  = "/{$index}/{$type}/{$documentId}";

+ 0 - 1
tests/Monolog/Handler/MongoDBHandlerTest.php

@@ -13,7 +13,6 @@ namespace Monolog\Handler;
 
 use MongoDB\Driver\Manager;
 use Monolog\Test\TestCase;
-use Monolog\Formatter\NormalizerFormatter;
 
 class MongoDBHandlerTest extends TestCase
 {

+ 1 - 2
tests/Monolog/Handler/TelegramBotHandlerTest.php

@@ -41,8 +41,7 @@ class TelegramBotHandlerTest extends TestCase
         string $parseMode = 'Markdown',
         bool $disableWebPagePreview = false,
         bool $disableNotification = true
-    ): void
-    {
+    ): void {
         $constructorArgs = [$apiKey, $channel, Logger::DEBUG, true, $parseMode, $disableWebPagePreview, $disableNotification];
 
         $this->handler = $this->getMockBuilder(TelegramBotHandler::class)