for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the KleijnWeb\SwaggerBundle package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace KleijnWeb\SwaggerBundle\Document;
use Symfony\Component\Yaml\Yaml;
/**
* @author John Kleijn <[email protected]>
class SwaggerDocument
{
* @var string
private $uri;
* @var object
private $definition;
* @var OperationObject[]
private $operations;
* @param string $pathFileName
* @param object $definition
public function __construct($pathFileName, $definition)
$this->uri = $pathFileName;
$this->definition = $definition;
}
* @return object
public function getDefinition()
return $this->definition;
public function getPathDefinitions()
return $this->definition->paths;
* @param string $path
* @param string $method
* @return OperationObject
public function getOperationObject($path, $method)
$key = "$path::$method";
if (isset($this->operations[$key])) {
return $this->operations[$key];
return $this->operations[$key] = new OperationObject($this, $path, $method);
* @deprecated
public function getOperationDefinition($path, $method)
return $this->getOperationObject($path, $method)->getDefinition();