* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ abstract class OpenAPIAbstract extends GeneratorAbstract { const FLOW_AUTHORIZATION_CODE = 0; const FLOW_IMPLICIT = 1; const FLOW_PASSWORD = 2; const FLOW_CLIENT_CREDENTIALS = 3; /** @var \PSX\Schema\Parser\Popo\Dumper */ protected $dumper; /** @var string */ protected $apiVersion; /** @var string */ protected $baseUri; /** @var string */ protected $title; /** @var string */ protected $description; /** @var string */ protected $tos; /** @var string */ protected $contactName; /** @var string */ protected $contactUrl; /** @var string */ protected $contactEmail; /** @var string */ protected $licenseName; /** @var string */ protected $licenseUrl; /** @var array */ protected $authFlows = []; /** @var array */ protected $tags = []; /** * @param \Doctrine\Common\Annotations\Reader $reader * @param integer $apiVersion * @param string $baseUri */ public function __construct(Reader $reader, $apiVersion, $baseUri) { $this->dumper = new Dumper($reader); $this->apiVersion = $apiVersion; $this->baseUri = $baseUri; $this->authFlows = []; } /** * The title of the application * * @param string $title */ public function setTitle(string $title) { $this->title = $title; } /** * A short description of the application. CommonMark syntax MAY be used for * rich text representation * * @param string|null $description */ public function setDescription(?string $description) { $this->description = $description; } /** * A URL to the Terms of Service for the API. MUST be in the format of a URL * * @param string|null $tos */ public function setTermsOfService(?string $tos) { $this->tos = $tos; } /** * The identifying name of the contact person/organization * * @param string|null $contactName */ public function setContactName(?string $contactName) { $this->contactName = $contactName; } /** * The URL pointing to the contact information. MUST be in the format of a * URL * * @param string|null $contactUrl */ public function setContactUrl(?string $contactUrl) { $this->contactUrl = $contactUrl; } /** * The email address of the contact person/organization. MUST be in the * format of an email address * * @param string|null $contactEmail */ public function setContactEmail(?string $contactEmail) { $this->contactEmail = $contactEmail; } /** * The license name used for the API * * @param string|null $licenseName */ public function setLicenseName(?string $licenseName) { $this->licenseName = $licenseName; } /** * A URL to the license used for the API. MUST be in the format of a URL * * @param string|null $licenseUrl */ public function setLicenseUrl(?string $licenseUrl) { $this->licenseUrl = $licenseUrl; } /** * Configuration details for a supported OAuth Flow * * @param string $name * @param integer $flow * @param string|null $authorizationUrl * @param string $tokenUrl * @param string|null $refreshUrl * @param array|null $scopes */ public function setAuthorizationFlow( string $name, int $flow, ?string $authorizationUrl, string $tokenUrl, ?string $refreshUrl = null, ?array $scopes = null, ) { if (!isset($this->authFlows[$name])) { $this->authFlows[$name] = []; } $this->authFlows[$name][] = [$flow, $authorizationUrl, $tokenUrl, $refreshUrl, $scopes]; } /** * Adds metadata to a single tag that is used by the Operation Object. It is * not mandatory to have a Tag Object per tag defined in the Operation * Object instances * * @param string $name * @param string $description */ public function addTag(string $name, string $description) { $this->tags[] = $this->newTag($name, $description); } /** * @param string $name * @param string $description * @return object */ abstract protected function newTag(string $name, string $description); } __halt_compiler();----SIGNATURE:----s6xLfB47aPTIl7hofHscyW3GDWY5KcfUCUP88W+pqpzJOB5nvhLMtxxwgSYXogpFmgTUL1NoTW2uwQ1PO9VZmwsq59ZYAypYfWRhWPbXzUs03sjr4VALvhwxGhs5qQ0qDMr8qxk44RWnUae/RZXQ/tTOG1w9iCa2Wl9j2u9CmOry9FLi00veX8xABHVMwglmFV1FHuFOMtfe7FTvXjEK1+4HMgjfgfc8qxSrKlL6SvAd4US3tnkktTYkZ4RfytcAU2ZoFRLJ5pr4EIkgAW25MiZf+/K5Sg9RnVXjXTKU4m1MmEFuWAEIPQg4FsXevsCbdXpOadtqf/oEE5IK0dNQgdFnnBlEsFt0GBwDoj0V87KY1g9wx/0MgaQE4zq9WgelWCCsuwhXxeNa6u4jxr0cwq/PvKzg8J/r3MO8n80FGSuOvkXVMTvHLaDSf1WZR8iJwBqkHeIR1fbxzgzyQ/MvXEjiiBrOxhjiYvzuHKmGs+hA/45VkPbSgeJvvXTU1dEVBQJoctiZlE/gokNCC7N09xRx7j82D4P3P8DagryYyyiAYFWBaxU4Dd9J5+Tw8UlKRa50mrsIlX8fwlYJ/KoKXQNyynAKK8qLPCBRvdZF3rFjBgy5sIt4QkjwVfDl/jT8ln5a3Pt7/TOmC7fXXr3ZoHJWy/qjy/ANJ7FME48/ExU=----ATTACHMENT:----NDY4MTg4MjIwOTM0MjMzMiA1NjUyNTc2MDYxNTAzODk0IDgzNTIzNjA1MjQwNzY4MzA=