* @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:----ZSTY4oJV5rWPp9yH/ngbS0HvW3au/SJWSMxWH3+arNhxlvo2mmwy9AH8rFz07aZN6oofGrEp/D3YrdISam0QYPknMUBMFrdpB7KIMVMeZp1vVQGqdP0O7CbyUXzHLWZyWqExW6h/LSm97ZijMZLMlDsBf+sMVvfA2RS7s3BnHvRfEzSu/X7le63ESzvFQF8qg43qlzeyos+iE3aEWUH7pJFVcfaLb7fdog1sdM7/YYxjWYNM8qg1Wd5ftT3uKhvHIxLbIC3KNs9w72RSIO5Ki6ssTyMhC1ME7RKvdCgh7JASuBJKhwJk1MEUTNEo1BrYwzMwvxnkDrYRU0nN0ZTHG8JhpuhJ3r72xqtSqpo+UNKg4Zd5TGrvxoXiOd6NYfX9znDi5hJhcGsaca3vN0Inscm6oTMbHesb4FXoBSExWlDKKypm1YTB5Ozy3Va8HEsYvX7AXyLtMz2kvCsbR4Rh0WGypYFdQezjjtgshDxU3mxcaY69K5F1LEl3kO1ZEY4JjQc7DRHuvzEW985lW5KRp0VQwe29rwNqhwvFxE4fRAQgxUqSr4q0w1L0WhuMXmOurbEdFxqXoOK63bHmYe1R2bry0HbYnWYJCBhEekn7wRJ+85AOmulaz2ZxWO5wKqX/Wy/EeDBwP0m4mTQxmM9Dltq9V7L0QABHGayJh57m6Fw=----ATTACHMENT:----MjA2MTg5ODA4ODgzODI1MyAxMjgxNzc0OTEzNTA5MDUzIDU2NjU5OTE1MzcwMjU0MTM=