示例#1
0
文件: Dumper.php 项目: raml-php/raml
 public function dump(Definition $definition, string $filepath)
 {
     $file = new SplFileInfo($filepath);
     if ($file->isDir() || !$file->isWritable()) {
         throw new RuntimeException("Given file {$filepath} is directory or is unwritable");
     }
     $definitionHydrator = new DefinitionHydrator();
     return yaml_emit_file($file->getPathname(), $definitionHydrator->extract($definition));
 }