* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class ResourceBuilder implements ResourceBuilderInterface { /** @var SchemaManagerInterface */ private $schemaManager; /** @var Resource */ private $resource; /** @var Definitions */ private $definitions; /** @var SpecificationInterface */ private $specification; public function __construct(SchemaManagerInterface $schemaManager, int $status, string $path) { $this->schemaManager = $schemaManager; $this->resource = new Resource($status, $path); $this->definitions = new Definitions(); $this->specification = Specification::fromResource($this->resource, $this->definitions); } /** * @inheritDoc */ public function setTitle(string $title): void { $this->resource->setTitle($title); } /** * @inheritDoc */ public function setDescription(string $description): void { $this->resource->setDescription($description); } /** * @inheritDoc */ public function setPathParameters(string $typeName): Builder { $builder = new Builder(); $this->definitions->addType($typeName, $builder->getType()); $this->resource->setPathParameters($typeName); return $builder; } /** * @inheritDoc */ public function addMethod(string $methodName): MethodBuilderInterface { $builder = new MethodBuilder($this->schemaManager, $this->definitions, $methodName); $this->resource->addMethod($builder->getMethod()); return $builder; } /** * @inheritDoc */ public function setTags(array $tags): void { $this->resource->setTags($tags); } /** * @inheritDoc */ public function addResource(int $status, string $path): ResourceBuilderInterface { $builder = new static($this->schemaManager, $status, $path); $builder->definitions = $this->definitions; $builder->specification = $this->specification; $this->specification->getResourceCollection()->set($builder->resource); return $builder; } /** * @inheritDoc */ public function getSpecification(): SpecificationInterface { return $this->specification; } } __halt_compiler();----SIGNATURE:----e/BxXAx+VqlT9kgzSwOjbyVz77rHzL47IvTr3xfqk+JlgLvT/KJnxnP3Ep20WjTcvcoYCztlMSLrf2VEb9j1GF8A6S8AgNwg3pUJB/E24CAsf3TS7IExQOg/6tGVfCdtFjRSnN6+iNLTzDsbxnlVdjn/KAfSy0e3jsaWQr2DOQ2bjY5zbyaRzSWN+iE7/SP4EHTje4UZUUoNWPGNMuaz4egqJeObA2SJ6NVLYljLIzcSo5roHrH42v9ysRESV/Hb/L8QkMak3nPIyd8d41liplj555NU2R/5ncHxcX4+IALh/dqtG14OfGVTMdN0UQvJowqzMlZw8x2x6sYNvbz69Fa89Zj27tvixfu6SuuZBchxUy8nRovcqEEfc2tLS/3HsC0ArWKyKXDvH5mFaGxpeuzkbHBBFeWAotXHDmgBs/XSqcRUbeg3F803CD4wPUTIRLprJ2fhNobEDFtuD/2N5zODFVs9Ki3u6eknGmmbPUBJModALTY6IZveV5QvBvcq0773Szje1SU5jeaJuBNkM8an6CEvvQ01zfwqkJhOetlpcggssWfk/5hKcsvj/3BqPNW/yqOxo4ns0g5RDUyyZyq3MT2v8F2YAviITI7BJT0jbCZnb7CNHNc+lvPrSoRqb53ZVw+N1nKnpYSQJpWD5qwam6WtvCpCzYx2NTArfUw=----ATTACHMENT:----NzIwMDI5NjIyNDE0NDQ2MSA1MzYyODA0MzAwODQ5MTgwIDE4OTY4ODM2Mzg1MjAwMTA=