@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | * Guess MIME Type based on the path of the file and it's content. |
| 177 | 177 | * |
| 178 | 178 | * @param string $path |
| 179 | - * @param string|resource $content |
|
| 179 | + * @param string $content |
|
| 180 | 180 | * |
| 181 | 181 | * @return string|null MIME Type or NULL if no extension detected |
| 182 | 182 | */ |
@@ -254,6 +254,9 @@ discard block |
||
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | + /** |
|
| 258 | + * @param resource $resource |
|
| 259 | + */ |
|
| 257 | 260 | public static function isSeekableStream($resource) |
| 258 | 261 | { |
| 259 | 262 | $metadata = stream_get_meta_data($resource); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * By default it will handle errors, exceptions and fatal errors |
| 54 | 54 | * |
| 55 | 55 | * @param LoggerInterface $logger |
| 56 | - * @param array|false $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling |
|
| 56 | + * @param boolean $errorLevelMap an array of E_* constant to LogLevel::* constant mapping, or false to disable error handling |
|
| 57 | 57 | * @param int|false $exceptionLevel a LogLevel::* constant, or false to disable exception handling |
| 58 | 58 | * @param int|false $fatalLevel a LogLevel::* constant, or false to disable fatal error handling |
| 59 | 59 | * @return ErrorHandler |
@@ -77,6 +77,9 @@ discard block |
||
| 77 | 77 | return $handler; |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | + /** |
|
| 81 | + * @param integer $level |
|
| 82 | + */ |
|
| 80 | 83 | public function registerExceptionHandler($level = null, $callPrevious = true) |
| 81 | 84 | { |
| 82 | 85 | $prev = set_exception_handler(array($this, 'handleException')); |
@@ -97,6 +100,9 @@ discard block |
||
| 97 | 100 | $this->handleOnlyReportedErrors = $handleOnlyReportedErrors; |
| 98 | 101 | } |
| 99 | 102 | |
| 103 | + /** |
|
| 104 | + * @param integer $level |
|
| 105 | + */ |
|
| 100 | 106 | public function registerFatalHandler($level = null, $reservedMemorySize = 20) |
| 101 | 107 | { |
| 102 | 108 | register_shutdown_function(array($this, 'handleFatalError')); |
@@ -147,6 +153,8 @@ discard block |
||
| 147 | 153 | |
| 148 | 154 | /** |
| 149 | 155 | * @private |
| 156 | + * @param integer $code |
|
| 157 | + * @param string $message |
|
| 150 | 158 | */ |
| 151 | 159 | public function handleError($code, $message, $file = '', $line = 0, $context = array()) |
| 152 | 160 | { |
@@ -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 | { |
@@ -125,6 +125,9 @@ discard block |
||
| 125 | 125 | return $message; |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | + /** |
|
| 129 | + * @return string |
|
| 130 | + */ |
|
| 128 | 131 | protected function convertToString($data) |
| 129 | 132 | { |
| 130 | 133 | if (null === $data || is_scalar($data)) { |
@@ -74,6 +74,9 @@ discard block |
||
| 74 | 74 | return $record; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | + /** |
|
| 78 | + * @param integer $nestingLevel |
|
| 79 | + */ |
|
| 77 | 80 | protected function formatObject($value, $nestingLevel) |
| 78 | 81 | { |
| 79 | 82 | $objectVars = get_object_vars($value); |
@@ -82,6 +85,9 @@ discard block |
||
| 82 | 85 | return $this->formatArray($objectVars, $nestingLevel); |
| 83 | 86 | } |
| 84 | 87 | |
| 88 | + /** |
|
| 89 | + * @param integer $nestingLevel |
|
| 90 | + */ |
|
| 85 | 91 | protected function formatException(\Exception $exception, $nestingLevel) |
| 86 | 92 | { |
| 87 | 93 | $formattedException = array( |
@@ -100,6 +106,9 @@ discard block |
||
| 100 | 106 | return $this->formatArray($formattedException, $nestingLevel); |
| 101 | 107 | } |
| 102 | 108 | |
| 109 | + /** |
|
| 110 | + * @param integer $nestingLevel |
|
| 111 | + */ |
|
| 103 | 112 | protected function formatDate(\DateTime $value, $nestingLevel) |
| 104 | 113 | { |
| 105 | 114 | return new \MongoDate($value->getTimestamp()); |
@@ -119,6 +119,9 @@ |
||
| 119 | 119 | return '[unknown('.gettype($data).')]'; |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | + /** |
|
| 123 | + * @param \Throwable $e |
|
| 124 | + */ |
|
| 122 | 125 | protected function normalizeException($e) |
| 123 | 126 | { |
| 124 | 127 | // TODO 2.0 only check for Throwable |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | /** |
| 120 | 120 | * Sets minimum logging level at which this handler will be triggered. |
| 121 | 121 | * |
| 122 | - * @param int|string $level Level or level name |
|
| 122 | + * @param integer $level Level or level name |
|
| 123 | 123 | * @return self |
| 124 | 124 | */ |
| 125 | 125 | public function setLevel($level) |
@@ -181,6 +181,10 @@ discard block |
||
| 181 | 181 | return $args; |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | + /** |
|
| 185 | + * @param string $style |
|
| 186 | + * @param string $string |
|
| 187 | + */ |
|
| 184 | 188 | private static function handleCustomStyles($style, $string) |
| 185 | 189 | { |
| 186 | 190 | static $colors = array('blue', 'green', 'red', 'magenta', 'orange', 'black', 'grey'); |
@@ -201,6 +205,9 @@ discard block |
||
| 201 | 205 | }, $style); |
| 202 | 206 | } |
| 203 | 207 | |
| 208 | + /** |
|
| 209 | + * @param string $title |
|
| 210 | + */ |
|
| 204 | 211 | private static function dump($title, array $dict) |
| 205 | 212 | { |
| 206 | 213 | $script = array(); |
@@ -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 | { |
@@ -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); |