original_string: public function provide($name, $args)
      {
          $services = $this->getServices();
          if (isset($services[$name])) {
              return (new Service($name, $services[$name]))
                  ->resolve($args, $this->getDi());
          } else {
              $method = self::METHOD_PREFIX . $name;
              if (method_exists($this, $method)) {
                  if (empty($args)) {
                      return $this->$method();
                  } else {
                      return call_user_func_array([$this, $method], $args);
                  }
              } else {
                  throw new Exception("Cannot load '{$name}' from " . get_class($this));
              }
          }
      }
code: public function provide($name, $args)
      {
          $services = $this->getServices();
          if (isset($services[$name])) {
              return (new Service($name, $services[$name]))
                  ->resolve($args, $this->getDi());
          } else {
              $method = self::METHOD_PREFIX . $name;
              if (method_exists($this, $method)) {
                  if (empty($args)) {
                      return $this->$method();
                  } else {
                      return call_user_func_array([$this, $method], $args);
                  }
              } else {
                  throw new Exception("Cannot load '{$name}' from " . get_class($this));
              }
          }
      }
code_tokens: public function provide ( $ name , $ args ) { $ services = $ this -> getServices ( ) ; if ( isset ( $ services [ $ name ] ) ) { return ( new Service ( $ name , $ services [ $ name ] ) ) -> resolve ( $ args , $ this -> getDi ( ) ) ; } else { $ method = self :: METHOD_PREFIX . $ name ; if ( method_exists ( $ this , $ method ) ) { if ( empty ( $ args ) ) { return $ this -> $ method ( ) ; } else { return call_user_func_array ( [ $ this , $ method ] , $ args ) ; } } else { throw new Exception ( "Cannot load '{$name}' from " . get_class ( $ this ) ) ; } } }
docstring: Creates service instance
  
  @param string $name service name
  @param array $args arguments to create instance
docstring_tokens: Creates service instance