original_string: public static function factory($name)
      {
          if (!isset(self::$services[$name])) {
              throw new \RuntimeException("The service [$name] don't register.");
          }
  
          $service = self::$services[$name];
  
          if (\is_object($service) && method_exists($service, '__invoke')) {
              return $service();
          }
  
          return $service;
      }
code: public static function factory($name)
      {
          if (!isset(self::$services[$name])) {
              throw new \RuntimeException("The service [$name] don't register.");
          }
  
          $service = self::$services[$name];
  
          if (\is_object($service) && method_exists($service, '__invoke')) {
              return $service();
          }
  
          return $service;
      }
code_tokens: public static function factory ( $ name ) { if ( ! isset ( self :: $ services [ $ name ] ) ) { throw new \ RuntimeException ( "The service [$name] don't register." ) ; } $ service = self :: $ services [ $ name ] ; if ( \ is_object ( $ service ) && method_exists ( $ service , '__invoke' ) ) { return $ service ( ) ; } return $ service ; }
docstring: create a app service by name
  it always return a new instance.
  @param string $name
  @return mixed
  @throws \RuntimeException
docstring_tokens: create a app service by name it always return a new instance .