예제 #1
0
 /**
  * Writes the class to a file.
  */
 public function write()
 {
     try {
         $dir = $this->path->isDir() ? $this->path->getPathname() : $this->path->getPath();
         $path = $dir . '/' . $this->baseClass->getClassName() . $this->baseClass->getExtension();
         if (!file_exists($dir)) {
             $this->fileSystem->mkdir($dir, 0777, true);
         }
         //if (!file_exists($path)) {
         file_put_contents($path, $this->baseClass->generate());
         //}
     } catch (IOExceptionInterface $e) {
     }
 }