Ver código fonte

Declaring That a Logger Can Throw an Exception

krzysiekpiasecki 9 anos atrás
pai
commit
4ebf6fa43f
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      src/Monolog/Logger.php

+ 4 - 0
src/Monolog/Logger.php

@@ -187,6 +187,7 @@ class Logger implements LoggerInterface
      * Pops a handler from the stack
      * Pops a handler from the stack
      *
      *
      * @return HandlerInterface
      * @return HandlerInterface
+     * @throws \LogicException If empty handler stack
      */
      */
     public function popHandler(): HandlerInterface
     public function popHandler(): HandlerInterface
     {
     {
@@ -240,6 +241,7 @@ class Logger implements LoggerInterface
      * Removes the processor on top of the stack and returns it.
      * Removes the processor on top of the stack and returns it.
      *
      *
      * @return callable
      * @return callable
+     * @throws \LogicException If empty processor stack     
      */
      */
     public function popProcessor(): callable
     public function popProcessor(): callable
     {
     {
@@ -347,6 +349,7 @@ class Logger implements LoggerInterface
      *
      *
      * @param  int    $level
      * @param  int    $level
      * @return string
      * @return string
+     * @throws \Psr\Log\InvalidArgumentException If level is not defined
      */
      */
     public static function getLevelName(int $level): string
     public static function getLevelName(int $level): string
     {
     {
@@ -362,6 +365,7 @@ class Logger implements LoggerInterface
      *
      *
      * @param string|int Level number (monolog) or name (PSR-3)
      * @param string|int Level number (monolog) or name (PSR-3)
      * @return int
      * @return int
+     * @throws \Psr\Log\InvalidArgumentException If level is not defined
      */
      */
     public static function toMonologLevel($level): int
     public static function toMonologLevel($level): int
     {
     {