original_string: protected function writeFile($table, $model)
      {
          $filename = StringUtils::prettifyTableName($table, $this->prefix).'.php';
  
          if (!is_dir($this->path)) {
              $oldUMask = umask(0);
              echo 'creating path: '.$this->path.LF;
              mkdir($this->path, 0777, true);
              umask($oldUMask);
              if (!is_dir($this->path)) {
                  throw new Exception('dir '.$this->path.' could not be created');
              }
          }
          $result = file_put_contents($this->path.'/'.$filename, $model);
  
          return ['filename' => $this->path.'/'.$filename, 'result' => $result];
      }
code: protected function writeFile($table, $model)
      {
          $filename = StringUtils::prettifyTableName($table, $this->prefix).'.php';
  
          if (!is_dir($this->path)) {
              $oldUMask = umask(0);
              echo 'creating path: '.$this->path.LF;
              mkdir($this->path, 0777, true);
              umask($oldUMask);
              if (!is_dir($this->path)) {
                  throw new Exception('dir '.$this->path.' could not be created');
              }
          }
          $result = file_put_contents($this->path.'/'.$filename, $model);
  
          return ['filename' => $this->path.'/'.$filename, 'result' => $result];
      }
code_tokens: protected function writeFile ( $ table , $ model ) { $ filename = StringUtils :: prettifyTableName ( $ table , $ this -> prefix ) . '.php' ; if ( ! is_dir ( $ this -> path ) ) { $ oldUMask = umask ( 0 ) ; echo 'creating path: ' . $ this -> path . LF ; mkdir ( $ this -> path , 0777 , true ) ; umask ( $ oldUMask ) ; if ( ! is_dir ( $ this -> path ) ) { throw new Exception ( 'dir ' . $ this -> path . ' could not be created' ) ; } } $ result = file_put_contents ( $ this -> path . '/' . $ filename , $ model ) ; return [ 'filename' => $ this -> path . '/' . $ filename , 'result' => $ result ] ; }
docstring: Write the actual TableName.php file.
  
  @param $table
  @param Model $model
  
  @throws Exception
  
  @return array
docstring_tokens: Write the actual TableName . php file .