getVersion() public méthode

Get the version string of the API
public getVersion ( ) : string
Résultat string
Exemple #1
0
 /**
  * @param string $output file to generate
  */
 public function generate($output)
 {
     $html = $this->twig->render('index.html.twig', array('title' => $this->specification->getTitle(), 'base_url' => $this->specification->getBaseUrl(), 'security' => $this->specification->getSecuritySchemes(), 'resources' => $this->specification->getResources(), 'documentation' => $this->specification->getDocumentationList(), 'base_dir_raml' => $this->base_dir_raml, 'version' => $this->specification->getVersion()));
     file_put_contents($output, $html);
 }
Exemple #2
0
 /**
  * Build namespace given ApiDefinition and base namespace
  *
  * @param  ApiDefinition $definition Checks if definition has version
  * @param  string        $namespace  Base
  * @return string
  */
 protected function buildNamespace(ApiDefinition $definition, $namespace)
 {
     if ($this->config['version_in_namespace'] && $definition->getVersion()) {
         $namespace .= '\\' . preg_replace(array('/(^[0-9])/', '/[^a-zA-Z0-9]/'), array('Version\\1', '_'), $definition->getVersion());
     }
     return $namespace;
 }
Exemple #3
0
 /**
  * {@inheritdoc}
  */
 public function getRoutePath()
 {
     return '/' . $this->apiDefinition->getVersion() . $this->resource->getUri();
 }