@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * Formats a log record. |
| 80 | 80 | * |
| 81 | 81 | * @param array $record A record to format |
| 82 | - * @return mixed The formatted record |
|
| 82 | + * @return string The formatted record |
|
| 83 | 83 | */ |
| 84 | 84 | public function format(array $record) |
| 85 | 85 | { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * Formats a set of log records. |
| 114 | 114 | * |
| 115 | 115 | * @param array $records A set of records to format |
| 116 | - * @return mixed The formatted set of records |
|
| 116 | + * @return string The formatted set of records |
|
| 117 | 117 | */ |
| 118 | 118 | public function formatBatch(array $records) |
| 119 | 119 | { |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | * Normalizes given exception with or without its own stack trace based on |
| 164 | 164 | * `includeStacktraces` property. |
| 165 | 165 | * |
| 166 | - * @param Exception|Throwable $e |
|
| 166 | + * @param Exception $e |
|
| 167 | 167 | * |
| 168 | 168 | * @return array |
| 169 | 169 | */ |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | public function format(array $record) |
| 72 | 72 | { |
| 73 | - return $this->toJson($this->normalize($record), true) . ($this->appendNewline ? "\n" : ''); |
|
| 73 | + return $this->toJson($this->normalize($record), true).($this->appendNewline ? "\n" : ''); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | |
| 121 | 121 | $oldNewline = $this->appendNewline; |
| 122 | 122 | $this->appendNewline = false; |
| 123 | - array_walk($records, function (&$value, $key) use ($instance) { |
|
| 123 | + array_walk($records, function(&$value, $key) use ($instance) { |
|
| 124 | 124 | $value = $instance->format($value); |
| 125 | 125 | }); |
| 126 | 126 | $this->appendNewline = $oldNewline; |
@@ -72,6 +72,9 @@ discard block |
||
| 72 | 72 | return $record; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | + /** |
|
| 76 | + * @param integer $nestingLevel |
|
| 77 | + */ |
|
| 75 | 78 | protected function formatObject($value, $nestingLevel) |
| 76 | 79 | { |
| 77 | 80 | $objectVars = get_object_vars($value); |
@@ -80,6 +83,9 @@ discard block |
||
| 80 | 83 | return $this->formatArray($objectVars, $nestingLevel); |
| 81 | 84 | } |
| 82 | 85 | |
| 86 | + /** |
|
| 87 | + * @param integer $nestingLevel |
|
| 88 | + */ |
|
| 83 | 89 | protected function formatException(\Exception $exception, $nestingLevel) |
| 84 | 90 | { |
| 85 | 91 | $formattedException = array( |
@@ -98,6 +104,9 @@ discard block |
||
| 98 | 104 | return $this->formatArray($formattedException, $nestingLevel); |
| 99 | 105 | } |
| 100 | 106 | |
| 107 | + /** |
|
| 108 | + * @param integer $nestingLevel |
|
| 109 | + */ |
|
| 101 | 110 | protected function formatDate(\DateTime $value, $nestingLevel) |
| 102 | 111 | { |
| 103 | 112 | return new \MongoDate($value->getTimestamp()); |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | 'class' => get_class($exception), |
| 87 | 87 | 'message' => $exception->getMessage(), |
| 88 | 88 | 'code' => $exception->getCode(), |
| 89 | - 'file' => $exception->getFile() . ':' . $exception->getLine(), |
|
| 89 | + 'file' => $exception->getFile().':'.$exception->getLine(), |
|
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | 92 | if ($this->exceptionTraceAsString === true) { |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | /** |
| 119 | 119 | * Sets minimum logging level at which this handler will be triggered. |
| 120 | 120 | * |
| 121 | - * @param int|string $level Level or level name |
|
| 121 | + * @param integer $level Level or level name |
|
| 122 | 122 | * @return self |
| 123 | 123 | */ |
| 124 | 124 | public function setLevel($level) |
@@ -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); |
@@ -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)) { |
@@ -212,7 +212,7 @@ |
||
| 212 | 212 | /** |
| 213 | 213 | * Gets extra parameters supported by Raven that can be found in "extra" and "context" |
| 214 | 214 | * |
| 215 | - * @return array |
|
| 215 | + * @return string[] |
|
| 216 | 216 | */ |
| 217 | 217 | protected function getExtraParameters() |
| 218 | 218 | { |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $level = $this->level; |
| 75 | 75 | |
| 76 | 76 | // filter records based on their level |
| 77 | - $records = array_filter($records, function ($record) use ($level) { |
|
| 77 | + $records = array_filter($records, function($record) use ($level) { |
|
| 78 | 78 | return $record['level'] >= $level; |
| 79 | 79 | }); |
| 80 | 80 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | // the record with the highest severity is the "main" one |
| 86 | - $record = array_reduce($records, function ($highest, $record) { |
|
| 86 | + $record = array_reduce($records, function($highest, $record) { |
|
| 87 | 87 | if ($record['level'] >= $highest['level']) { |
| 88 | 88 | return $record; |
| 89 | 89 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | protected $factor; |
| 39 | 39 | |
| 40 | 40 | /** |
| 41 | - * @param callable|HandlerInterface $handler Handler or factory callable($record, $fingersCrossedHandler). |
|
| 41 | + * @param TestHandler $handler Handler or factory callable($record, $fingersCrossedHandler). |
|
| 42 | 42 | * @param int $factor Sample factor |
| 43 | 43 | */ |
| 44 | 44 | public function __construct($handler, $factor) |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | /** |
| 160 | 160 | * Get current in-transfer timeout |
| 161 | 161 | * |
| 162 | - * @return float |
|
| 162 | + * @return integer |
|
| 163 | 163 | */ |
| 164 | 164 | public function getTimeout() |
| 165 | 165 | { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | /** |
| 170 | 170 | * Get current local writing timeout |
| 171 | 171 | * |
| 172 | - * @return float |
|
| 172 | + * @return integer |
|
| 173 | 173 | */ |
| 174 | 174 | public function getWritingTimeout() |
| 175 | 175 | { |
@@ -234,6 +234,9 @@ discard block |
||
| 234 | 234 | return stream_get_meta_data($this->resource); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | + /** |
|
| 238 | + * @param double $value |
|
| 239 | + */ |
|
| 237 | 240 | private function validateTimeout($value) |
| 238 | 241 | { |
| 239 | 242 | $ok = filter_var($value, FILTER_VALIDATE_FLOAT); |
@@ -281,6 +284,9 @@ discard block |
||
| 281 | 284 | } |
| 282 | 285 | } |
| 283 | 286 | |
| 287 | + /** |
|
| 288 | + * @param string $data |
|
| 289 | + */ |
|
| 284 | 290 | private function writeToSocket($data) |
| 285 | 291 | { |
| 286 | 292 | $length = strlen($data); |
@@ -310,6 +316,9 @@ discard block |
||
| 310 | 316 | } |
| 311 | 317 | } |
| 312 | 318 | |
| 319 | + /** |
|
| 320 | + * @param integer $sent |
|
| 321 | + */ |
|
| 313 | 322 | private function writingIsTimedOut($sent) |
| 314 | 323 | { |
| 315 | 324 | $writingTimeout = (int) floor($this->writingTimeout); |
@@ -186,7 +186,7 @@ |
||
| 186 | 186 | public function isConnected() |
| 187 | 187 | { |
| 188 | 188 | return is_resource($this->resource) |
| 189 | - && !feof($this->resource); // on TCP - other party can close connection. |
|
| 189 | + && !feof($this->resource); // on TCP - other party can close connection. |
|
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | /** |