original_string: protected function makeModelInstance($class)
      {
          if ( ! class_exists($class)) {
              throw new UnexpectedValueException("Class '{$class}' does not exist");
          }
  
          $instance = new $class;
  
          if ( ! $instance instanceof Model) {
              throw new UnexpectedValueException("Instance of '{$class}' is not a model");
          }
  
          $this->modelInstance = $instance;
  
          $this->modelReflection = new ReflectionClass($class);
  
          return $this;
      }
code: protected function makeModelInstance($class)
      {
          if ( ! class_exists($class)) {
              throw new UnexpectedValueException("Class '{$class}' does not exist");
          }
  
          $instance = new $class;
  
          if ( ! $instance instanceof Model) {
              throw new UnexpectedValueException("Instance of '{$class}' is not a model");
          }
  
          $this->modelInstance = $instance;
  
          $this->modelReflection = new ReflectionClass($class);
  
          return $this;
      }
code_tokens: protected function makeModelInstance ( $ class ) { if ( ! class_exists ( $ class ) ) { throw new UnexpectedValueException ( "Class '{$class}' does not exist" ) ; } $ instance = new $ class ; if ( ! $ instance instanceof Model ) { throw new UnexpectedValueException ( "Instance of '{$class}' is not a model" ) ; } $ this -> modelInstance = $ instance ; $ this -> modelReflection = new ReflectionClass ( $ class ) ; return $ this ; }
docstring: Makes and sets instance of the model class and stores it.
  
  @param string $class
  @return $this
docstring_tokens: Makes and sets instance of the model class and stores it .