@@ -11,11 +11,11 @@ |
||
11 | 11 | |
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | -use Monolog\Formatter\FormatterInterface; |
|
15 | -use Monolog\Formatter\ElasticaFormatter; |
|
16 | -use Monolog\Logger; |
|
17 | 14 | use Elastica\Client; |
18 | 15 | use Elastica\Exception\ExceptionInterface; |
16 | +use Monolog\Formatter\ElasticaFormatter; |
|
17 | +use Monolog\Formatter\FormatterInterface; |
|
18 | +use Monolog\Logger; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * Elastic Search handler |
@@ -57,9 +57,9 @@ |
||
57 | 57 | $this->client = $client; |
58 | 58 | $this->options = array_merge( |
59 | 59 | array( |
60 | - 'index' => 'monolog', // Elastic index name |
|
61 | - 'type' => 'record', // Elastic document type |
|
62 | - 'ignore_error' => false, // Suppress Elastica exceptions |
|
60 | + 'index' => 'monolog', // Elastic index name |
|
61 | + 'type' => 'record', // Elastic document type |
|
62 | + 'ignore_error' => false, // Suppress Elastica exceptions |
|
63 | 63 | ), |
64 | 64 | $options |
65 | 65 | ); |
@@ -47,7 +47,7 @@ |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
50 | - * @return array With all available types |
|
50 | + * @return integer[] With all available types |
|
51 | 51 | */ |
52 | 52 | public static function getAvailableTypes() |
53 | 53 | { |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | -use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; |
|
15 | 14 | use Monolog\Handler\FingersCrossed\ActivationStrategyInterface; |
15 | +use Monolog\Handler\FingersCrossed\ErrorLevelActivationStrategy; |
|
16 | 16 | use Monolog\Logger; |
17 | 17 | use Monolog\ResettableInterface; |
18 | 18 |
@@ -163,7 +163,7 @@ |
||
163 | 163 | { |
164 | 164 | if (null !== $this->passthruLevel) { |
165 | 165 | $level = $this->passthruLevel; |
166 | - $this->buffer = array_filter($this->buffer, function ($record) use ($level) { |
|
166 | + $this->buffer = array_filter($this->buffer, function($record) use ($level) { |
|
167 | 167 | return $record['level'] >= $level; |
168 | 168 | }); |
169 | 169 | if (count($this->buffer) > 0) { |
@@ -163,7 +163,7 @@ |
||
163 | 163 | { |
164 | 164 | if (null !== $this->passthruLevel) { |
165 | 165 | $level = $this->passthruLevel; |
166 | - $this->buffer = array_filter($this->buffer, function ($record) use ($level) { |
|
166 | + $this->buffer = array_filter($this->buffer, function ($record) use ($level){ |
|
167 | 167 | return $record['level'] >= $level; |
168 | 168 | }); |
169 | 169 | if (count($this->buffer) > 0) { |
@@ -11,9 +11,9 @@ |
||
11 | 11 | |
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | -use Monolog\Logger; |
|
15 | 14 | use Monolog\Formatter\FlowdockFormatter; |
16 | 15 | use Monolog\Formatter\FormatterInterface; |
16 | +use Monolog\Logger; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Sends notifications through the Flowdock push API |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | $content = $this->buildContent($record); |
96 | 96 | |
97 | - return $this->buildHeader($content) . $content; |
|
97 | + return $this->buildHeader($content).$content; |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | /** |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | */ |
117 | 117 | private function buildHeader($content) |
118 | 118 | { |
119 | - $header = "POST /v1/messages/team_inbox/" . $this->apiToken . " HTTP/1.1\r\n"; |
|
119 | + $header = "POST /v1/messages/team_inbox/".$this->apiToken." HTTP/1.1\r\n"; |
|
120 | 120 | $header .= "Host: api.flowdock.com\r\n"; |
121 | 121 | $header .= "Content-Type: application/json\r\n"; |
122 | - $header .= "Content-Length: " . strlen($content) . "\r\n"; |
|
122 | + $header .= "Content-Length: ".strlen($content)."\r\n"; |
|
123 | 123 | $header .= "\r\n"; |
124 | 124 | |
125 | 125 | return $header; |
@@ -12,11 +12,11 @@ |
||
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | 14 | use Gelf\IMessagePublisher; |
15 | -use Gelf\PublisherInterface; |
|
16 | 15 | use Gelf\Publisher; |
16 | +use Gelf\PublisherInterface; |
|
17 | 17 | use InvalidArgumentException; |
18 | -use Monolog\Logger; |
|
19 | 18 | use Monolog\Formatter\GelfMessageFormatter; |
19 | +use Monolog\Logger; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * Handler to send messages to a Graylog2 (http://www.graylog2.org) server |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | -use Monolog\ResettableInterface; |
|
15 | 14 | use Monolog\Formatter\FormatterInterface; |
15 | +use Monolog\ResettableInterface; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * This simple wrapper class can be used to extend handlers functionality. |
@@ -74,6 +74,9 @@ |
||
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | + /** |
|
78 | + * @param string $endpoint |
|
79 | + */ |
|
77 | 80 | protected function send($data, $endpoint) |
78 | 81 | { |
79 | 82 | $url = sprintf("https://%s/%s/%s/", self::HOST, $endpoint, $this->token); |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | -use Monolog\Logger; |
|
15 | 14 | use Monolog\Formatter\LogglyFormatter; |
15 | +use Monolog\Logger; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Sends errors to Loggly. |
@@ -65,7 +65,7 @@ |
||
65 | 65 | { |
66 | 66 | $level = $this->level; |
67 | 67 | |
68 | - $records = array_filter($records, function ($record) use ($level) { |
|
68 | + $records = array_filter($records, function($record) use ($level) { |
|
69 | 69 | return ($record['level'] >= $level); |
70 | 70 | }); |
71 | 71 |
@@ -65,7 +65,7 @@ |
||
65 | 65 | { |
66 | 66 | $level = $this->level; |
67 | 67 | |
68 | - $records = array_filter($records, function ($record) use ($level) { |
|
68 | + $records = array_filter($records, function ($record) use ($level){ |
|
69 | 69 | return ($record['level'] >= $level); |
70 | 70 | }); |
71 | 71 |
@@ -29,6 +29,10 @@ |
||
29 | 29 | { |
30 | 30 | protected $mongoCollection; |
31 | 31 | |
32 | + /** |
|
33 | + * @param string $database |
|
34 | + * @param string $collection |
|
35 | + */ |
|
32 | 36 | public function __construct($mongo, $database, $collection, $level = Logger::DEBUG, $bubble = true) |
33 | 37 | { |
34 | 38 | if (!($mongo instanceof \MongoClient || $mongo instanceof \Mongo || $mongo instanceof \MongoDB\Client)) { |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | -use Monolog\Logger; |
|
15 | 14 | use Monolog\Formatter\NormalizerFormatter; |
15 | +use Monolog\Logger; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Logs to a MongoDB database. |
@@ -65,7 +65,7 @@ |
||
65 | 65 | protected $encoding = 'utf-8'; |
66 | 66 | |
67 | 67 | /** |
68 | - * @param string|array $to The receiver of the mail |
|
68 | + * @param string $to The receiver of the mail |
|
69 | 69 | * @param string $subject The subject of the mail |
70 | 70 | * @param string $from The sender of the mail |
71 | 71 | * @param int $level The minimum logging level at which this handler will be triggered |
@@ -11,8 +11,8 @@ |
||
11 | 11 | |
12 | 12 | namespace Monolog\Handler; |
13 | 13 | |
14 | -use Monolog\Logger; |
|
15 | 14 | use Monolog\Formatter\LineFormatter; |
15 | +use Monolog\Logger; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * NativeMailerHandler uses the mail() function to send the emails |
@@ -118,10 +118,10 @@ |
||
118 | 118 | protected function send($content, array $records) |
119 | 119 | { |
120 | 120 | $content = wordwrap($content, $this->maxColumnWidth); |
121 | - $headers = ltrim(implode("\r\n", $this->headers) . "\r\n", "\r\n"); |
|
122 | - $headers .= 'Content-type: ' . $this->getContentType() . '; charset=' . $this->getEncoding() . "\r\n"; |
|
121 | + $headers = ltrim(implode("\r\n", $this->headers)."\r\n", "\r\n"); |
|
122 | + $headers .= 'Content-type: '.$this->getContentType().'; charset='.$this->getEncoding()."\r\n"; |
|
123 | 123 | if ($this->getContentType() == 'text/html' && false === strpos($headers, 'MIME-Version:')) { |
124 | - $headers .= 'MIME-Version: 1.0' . "\r\n"; |
|
124 | + $headers .= 'MIME-Version: 1.0'."\r\n"; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $subject = $this->subject; |