コード例 #1
0
ファイル: RamlCommand.php プロジェクト: seytar/psx
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $documentation = Parser\Raml::fromFile($input->getArgument('file'), $input->getArgument('path'));
     switch ($input->getArgument('format')) {
         case 'serialize':
             $output->write(serialize($documentation));
             break;
         case 'php':
         default:
             $output->write(var_export($documentation, true));
             break;
     }
 }
コード例 #2
0
ファイル: Raml.php プロジェクト: seytar/psx
 public static function fromFile($file, $path)
 {
     if (!empty($file) && is_file($file)) {
         $basePath = pathinfo($file, PATHINFO_DIRNAME);
         $parser = new Raml($basePath);
         return $parser->parse(file_get_contents($file), $path);
     } else {
         throw new RuntimeException('Could not load raml schema ' . $file);
     }
 }
コード例 #3
0
ファイル: PropertyRamlController.php プロジェクト: seytar/psx
 public function getDocumentation()
 {
     return Parser\Raml::fromFile(__DIR__ . '/../../Resource/property.raml', $this->context->get(Context::KEY_PATH));
 }
コード例 #4
0
ファイル: RamlTest.php プロジェクト: seytar/psx
 /**
  * @expectedException \RuntimeException
  */
 public function testFromFileNotExistingFile()
 {
     Raml::fromFile(__DIR__ . '/foo.raml', '/bar/:bar_id');
 }