original_string: public static function addLogger(Logger $logger, ?string $name = null, bool $overwrite = false)
      {
          $name = $name ?: $logger->getName();
  
          if (isset(self::$loggers[$name]) && !$overwrite) {
              throw new InvalidArgumentException('Logger with the given name already exists');
          }
  
          self::$loggers[$name] = $logger;
      }
code: public static function addLogger(Logger $logger, ?string $name = null, bool $overwrite = false)
      {
          $name = $name ?: $logger->getName();
  
          if (isset(self::$loggers[$name]) && !$overwrite) {
              throw new InvalidArgumentException('Logger with the given name already exists');
          }
  
          self::$loggers[$name] = $logger;
      }
code_tokens: public static function addLogger ( Logger $ logger , ? string $ name = null , bool $ overwrite = false ) { $ name = $ name ? : $ logger -> getName ( ) ; if ( isset ( self :: $ loggers [ $ name ] ) && ! $ overwrite ) { throw new InvalidArgumentException ( 'Logger with the given name already exists' ) ; } self :: $ loggers [ $ name ] = $ logger ; }
docstring: Adds new logging channel to the registry
  
  @param  Logger                    $logger    Instance of the logging channel
  @param  string|null               $name      Name of the logging channel ($logger->getName() by default)
  @param  bool                      $overwrite Overwrite instance in the registry if the given name already exists?
  @throws \InvalidArgumentException If $overwrite set to false and named Logger instance already exists
docstring_tokens: Adds new logging channel to the registry