original_string: public function registerService($name, $service, array $params = [], $shared = TRUE) {
          if(is_callable($service)) {
              $this->services[$name] = [ "shared" => $shared, "params" => $params, "callback" => $service ];
          }
          elseif(is_object($service)) {
              $this->services[$name] = [ "shared" => $shared, "object" => $service ];
          }
          elseif(is_string($service)) {
              $this->services[$name] = [ "shared" => $shared, "params" => $params, "classname" => $service ];
          }
          else {
              throw new Exception("Failed to register service.");
          }
      }
code: public function registerService($name, $service, array $params = [], $shared = TRUE) {
          if(is_callable($service)) {
              $this->services[$name] = [ "shared" => $shared, "params" => $params, "callback" => $service ];
          }
          elseif(is_object($service)) {
              $this->services[$name] = [ "shared" => $shared, "object" => $service ];
          }
          elseif(is_string($service)) {
              $this->services[$name] = [ "shared" => $shared, "params" => $params, "classname" => $service ];
          }
          else {
              throw new Exception("Failed to register service.");
          }
      }
code_tokens: public function registerService ( $ name , $ service , array $ params = [ ] , $ shared = TRUE ) { if ( is_callable ( $ service ) ) { $ this -> services [ $ name ] = [ "shared" => $ shared , "params" => $ params , "callback" => $ service ] ; } elseif ( is_object ( $ service ) ) { $ this -> services [ $ name ] = [ "shared" => $ shared , "object" => $ service ] ; } elseif ( is_string ( $ service ) ) { $ this -> services [ $ name ] = [ "shared" => $ shared , "params" => $ params , "classname" => $ service ] ; } else { throw new Exception ( "Failed to register service." ) ; } }
docstring: Registers a custom Service
  
  @param string $name The service name
  @param mixed $service A service class name as string, a callable (which returns the service) or an Object that is the service itself.
  @param array $params If $service is a string/callable: Parameters that are passed to the constructor/callable when the service is created.
  @param bool $shared If the service is a string/callable, specify if the service should be shared.
docstring_tokens: Registers a custom Service