original_string: public function setLogger(\BearFramework\App\ILogger $logger): self
      {
          if ($this->logger !== null) {
              throw new \Exception('A logger is already set!');
          }
          $this->logger = $logger;
          return $this;
      }
code: public function setLogger(\BearFramework\App\ILogger $logger): self
      {
          if ($this->logger !== null) {
              throw new \Exception('A logger is already set!');
          }
          $this->logger = $logger;
          return $this;
      }
code_tokens: public function setLogger ( \ BearFramework \ App \ ILogger $ logger ) : self { if ( $ this -> logger !== null ) { throw new \ Exception ( 'A logger is already set!' ) ; } $ this -> logger = $ logger ; return $ this ; }
docstring: Sets a new logger.
  
  @param \BearFramework\App\ILogger $logger The logger to use.
  @return self Returns a reference to itself.
  @throws \Exception
docstring_tokens: Sets a new logger .