original_string: public function remove(Model $model = null)
      {
          if (func_num_args() === 0) {
              $this->connection->remove($this);
          } else {
              // avoid remove empty model
              if (is_null($model)) {
                  throw new \Exception('[Norm/Collection] Cannot remove null model');
              }
  
              $this->applyHook('removing', $model);
              $result = $this->connection->remove($this, $model);
  
              if ($result) {
                  $model->reset();
              }
  
              $this->applyHook('removed', $model);
          }
      }
code: public function remove(Model $model = null)
      {
          if (func_num_args() === 0) {
              $this->connection->remove($this);
          } else {
              // avoid remove empty model
              if (is_null($model)) {
                  throw new \Exception('[Norm/Collection] Cannot remove null model');
              }
  
              $this->applyHook('removing', $model);
              $result = $this->connection->remove($this, $model);
  
              if ($result) {
                  $model->reset();
              }
  
              $this->applyHook('removed', $model);
          }
      }
code_tokens: public function remove ( Model $ model = null ) { if ( func_num_args ( ) === 0 ) { $ this -> connection -> remove ( $ this ) ; } else { // avoid remove empty model if ( is_null ( $ model ) ) { throw new \ Exception ( '[Norm/Collection] Cannot remove null model' ) ; } $ this -> applyHook ( 'removing' , $ model ) ; $ result = $ this -> connection -> remove ( $ this , $ model ) ; if ( $ result ) { $ model -> reset ( ) ; } $ this -> applyHook ( 'removed' , $ model ) ; } }
docstring: Remove single model
  
  @param \Norm\Model $model
  
  @return void
docstring_tokens: Remove single model