@@ -6,40 +6,40 @@ |
||
| 6 | 6 | |
| 7 | 7 | trait RefPart |
| 8 | 8 | { |
| 9 | - /** @var string */ |
|
| 10 | - private $ref; |
|
| 11 | - |
|
| 12 | - /** @var bool */ |
|
| 13 | - private $hasRef = false; |
|
| 14 | - |
|
| 15 | - private function parseRef(Map $data) |
|
| 16 | - { |
|
| 17 | - $this->ref = $data->get('$ref'); |
|
| 18 | - $this->hasRef = $data->has('$ref'); |
|
| 19 | - } |
|
| 20 | - |
|
| 21 | - /** |
|
| 22 | - * @return the string |
|
| 23 | - */ |
|
| 24 | - public function getRef() |
|
| 25 | - { |
|
| 26 | - return $this->ref; |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * @param |
|
| 31 | - * $ref |
|
| 32 | - */ |
|
| 33 | - public function setRef($ref) |
|
| 34 | - { |
|
| 35 | - $this->ref = $ref; |
|
| 36 | - $this->hasRef = $ref !== null; |
|
| 37 | - |
|
| 38 | - return $this; |
|
| 39 | - } |
|
| 40 | - |
|
| 41 | - public function hasRef() |
|
| 42 | - { |
|
| 43 | - return $this->hasRef; |
|
| 44 | - } |
|
| 9 | + /** @var string */ |
|
| 10 | + private $ref; |
|
| 11 | + |
|
| 12 | + /** @var bool */ |
|
| 13 | + private $hasRef = false; |
|
| 14 | + |
|
| 15 | + private function parseRef(Map $data) |
|
| 16 | + { |
|
| 17 | + $this->ref = $data->get('$ref'); |
|
| 18 | + $this->hasRef = $data->has('$ref'); |
|
| 19 | + } |
|
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * @return the string |
|
| 23 | + */ |
|
| 24 | + public function getRef() |
|
| 25 | + { |
|
| 26 | + return $this->ref; |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * @param |
|
| 31 | + * $ref |
|
| 32 | + */ |
|
| 33 | + public function setRef($ref) |
|
| 34 | + { |
|
| 35 | + $this->ref = $ref; |
|
| 36 | + $this->hasRef = $ref !== null; |
|
| 37 | + |
|
| 38 | + return $this; |
|
| 39 | + } |
|
| 40 | + |
|
| 41 | + public function hasRef() |
|
| 42 | + { |
|
| 43 | + return $this->hasRef; |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -7,19 +7,19 @@ |
||
| 7 | 7 | |
| 8 | 8 | trait SchemaPart |
| 9 | 9 | { |
| 10 | - /** @var Schema */ |
|
| 11 | - private $schema; |
|
| 10 | + /** @var Schema */ |
|
| 11 | + private $schema; |
|
| 12 | 12 | |
| 13 | - private function parseSchema(Map $data) |
|
| 14 | - { |
|
| 15 | - $this->schema = new Schema($data->get('schema')); |
|
| 16 | - } |
|
| 13 | + private function parseSchema(Map $data) |
|
| 14 | + { |
|
| 15 | + $this->schema = new Schema($data->get('schema')); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @return Schema |
|
| 20 | - */ |
|
| 21 | - public function getSchema() |
|
| 22 | - { |
|
| 23 | - return $this->schema; |
|
| 24 | - } |
|
| 18 | + /** |
|
| 19 | + * @return Schema |
|
| 20 | + */ |
|
| 21 | + public function getSchema() |
|
| 22 | + { |
|
| 23 | + return $this->schema; |
|
| 24 | + } |
|
| 25 | 25 | } |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | |
| 8 | 8 | trait ParametersPart |
| 9 | 9 | { |
| 10 | - /** @var Parameters */ |
|
| 11 | - private $parameters; |
|
| 10 | + /** @var Parameters */ |
|
| 11 | + private $parameters; |
|
| 12 | 12 | |
| 13 | - private function parseParameters(Map $data) |
|
| 14 | - { |
|
| 15 | - $this->parameters = new Parameters($data->get('parameters', new Map())); |
|
| 16 | - } |
|
| 13 | + private function parseParameters(Map $data) |
|
| 14 | + { |
|
| 15 | + $this->parameters = new Parameters($data->get('parameters', new Map())); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Return parameters. |
|
| 20 | - * |
|
| 21 | - * @return Parameters |
|
| 22 | - */ |
|
| 23 | - public function getParameters() |
|
| 24 | - { |
|
| 25 | - return $this->parameters; |
|
| 26 | - } |
|
| 18 | + /** |
|
| 19 | + * Return parameters. |
|
| 20 | + * |
|
| 21 | + * @return Parameters |
|
| 22 | + */ |
|
| 23 | + public function getParameters() |
|
| 24 | + { |
|
| 25 | + return $this->parameters; |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | |
| 8 | 8 | trait ResponsesPart |
| 9 | 9 | { |
| 10 | - /** @var Responses */ |
|
| 11 | - private $responses; |
|
| 10 | + /** @var Responses */ |
|
| 11 | + private $responses; |
|
| 12 | 12 | |
| 13 | - private function parseResponses(Map $data) |
|
| 14 | - { |
|
| 15 | - $this->responses = new Responses($data->get('responses', new Map())); |
|
| 16 | - } |
|
| 13 | + private function parseResponses(Map $data) |
|
| 14 | + { |
|
| 15 | + $this->responses = new Responses($data->get('responses', new Map())); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Return responses. |
|
| 20 | - * |
|
| 21 | - * @return Responses |
|
| 22 | - */ |
|
| 23 | - public function getResponses() |
|
| 24 | - { |
|
| 25 | - return $this->responses; |
|
| 26 | - } |
|
| 18 | + /** |
|
| 19 | + * Return responses. |
|
| 20 | + * |
|
| 21 | + * @return Responses |
|
| 22 | + */ |
|
| 23 | + public function getResponses() |
|
| 24 | + { |
|
| 25 | + return $this->responses; |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -6,31 +6,31 @@ |
||
| 6 | 6 | |
| 7 | 7 | trait DescriptionPart |
| 8 | 8 | { |
| 9 | - /** @var string */ |
|
| 10 | - private $description = false; |
|
| 9 | + /** @var string */ |
|
| 10 | + private $description = false; |
|
| 11 | 11 | |
| 12 | - private function parseDescription(Map $data) |
|
| 13 | - { |
|
| 14 | - $this->description = $data->get('description'); |
|
| 15 | - } |
|
| 12 | + private function parseDescription(Map $data) |
|
| 13 | + { |
|
| 14 | + $this->description = $data->get('description'); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @return string |
|
| 19 | - */ |
|
| 20 | - public function getDescription() |
|
| 21 | - { |
|
| 22 | - return $this->description; |
|
| 23 | - } |
|
| 17 | + /** |
|
| 18 | + * @return string |
|
| 19 | + */ |
|
| 20 | + public function getDescription() |
|
| 21 | + { |
|
| 22 | + return $this->description; |
|
| 23 | + } |
|
| 24 | 24 | |
| 25 | - /** |
|
| 26 | - * @param string $description |
|
| 27 | - * |
|
| 28 | - * @return $this |
|
| 29 | - */ |
|
| 30 | - public function setDescription($description) |
|
| 31 | - { |
|
| 32 | - $this->description = $description; |
|
| 25 | + /** |
|
| 26 | + * @param string $description |
|
| 27 | + * |
|
| 28 | + * @return $this |
|
| 29 | + */ |
|
| 30 | + public function setDescription($description) |
|
| 31 | + { |
|
| 32 | + $this->description = $description; |
|
| 33 | 33 | |
| 34 | - return $this; |
|
| 35 | - } |
|
| 34 | + return $this; |
|
| 35 | + } |
|
| 36 | 36 | } |
@@ -7,27 +7,27 @@ |
||
| 7 | 7 | |
| 8 | 8 | trait ItemsPart |
| 9 | 9 | { |
| 10 | - /** @var */ |
|
| 11 | - private $items; |
|
| 10 | + /** @var */ |
|
| 11 | + private $items; |
|
| 12 | 12 | |
| 13 | - private function parseItems(Map $data) |
|
| 14 | - { |
|
| 15 | - if ($data->has('items')) { |
|
| 16 | - $this->items = new Items($data->get('items')); |
|
| 17 | - } |
|
| 18 | - } |
|
| 13 | + private function parseItems(Map $data) |
|
| 14 | + { |
|
| 15 | + if ($data->has('items')) { |
|
| 16 | + $this->items = new Items($data->get('items')); |
|
| 17 | + } |
|
| 18 | + } |
|
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * Returns the items. |
|
| 22 | - * |
|
| 23 | - * @return Items |
|
| 24 | - */ |
|
| 25 | - public function getItems() |
|
| 26 | - { |
|
| 27 | - if ($this->items === null) { |
|
| 28 | - $this->items = new Items(); |
|
| 29 | - } |
|
| 20 | + /** |
|
| 21 | + * Returns the items. |
|
| 22 | + * |
|
| 23 | + * @return Items |
|
| 24 | + */ |
|
| 25 | + public function getItems() |
|
| 26 | + { |
|
| 27 | + if ($this->items === null) { |
|
| 28 | + $this->items = new Items(); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - return $this->items; |
|
| 32 | - } |
|
| 31 | + return $this->items; |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -7,20 +7,20 @@ |
||
| 7 | 7 | |
| 8 | 8 | trait ConsumesPart |
| 9 | 9 | { |
| 10 | - private $consumes; |
|
| 10 | + private $consumes; |
|
| 11 | 11 | |
| 12 | - private function parseConsumes(Map $data) |
|
| 13 | - { |
|
| 14 | - $this->consumes = $data->get('consumes', new Set()); |
|
| 15 | - } |
|
| 12 | + private function parseConsumes(Map $data) |
|
| 13 | + { |
|
| 14 | + $this->consumes = $data->get('consumes', new Set()); |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Return consumes. |
|
| 19 | - * |
|
| 20 | - * @return Set |
|
| 21 | - */ |
|
| 22 | - public function getConsumes() |
|
| 23 | - { |
|
| 24 | - return $this->consumes; |
|
| 25 | - } |
|
| 17 | + /** |
|
| 18 | + * Return consumes. |
|
| 19 | + * |
|
| 20 | + * @return Set |
|
| 21 | + */ |
|
| 22 | + public function getConsumes() |
|
| 23 | + { |
|
| 24 | + return $this->consumes; |
|
| 25 | + } |
|
| 26 | 26 | } |
@@ -7,27 +7,27 @@ |
||
| 7 | 7 | |
| 8 | 8 | trait ExtensionPart |
| 9 | 9 | { |
| 10 | - private $extensions; |
|
| 10 | + private $extensions; |
|
| 11 | 11 | |
| 12 | - private function parseExtensions(Map $data) |
|
| 13 | - { |
|
| 14 | - $this->extensions = new Map(); |
|
| 12 | + private function parseExtensions(Map $data) |
|
| 13 | + { |
|
| 14 | + $this->extensions = new Map(); |
|
| 15 | 15 | |
| 16 | - foreach ($data as $k => $v) { |
|
| 17 | - $key = new Text($k); |
|
| 18 | - if ($key->startsWith('x-')) { |
|
| 19 | - $this->extensions->set($key->substring(2), $v); |
|
| 20 | - } |
|
| 21 | - } |
|
| 22 | - } |
|
| 16 | + foreach ($data as $k => $v) { |
|
| 17 | + $key = new Text($k); |
|
| 18 | + if ($key->startsWith('x-')) { |
|
| 19 | + $this->extensions->set($key->substring(2), $v); |
|
| 20 | + } |
|
| 21 | + } |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | - /** |
|
| 25 | - * Returns extensions. |
|
| 26 | - * |
|
| 27 | - * @return Map |
|
| 28 | - */ |
|
| 29 | - public function getExtensions() |
|
| 30 | - { |
|
| 31 | - return $this->extensions; |
|
| 32 | - } |
|
| 24 | + /** |
|
| 25 | + * Returns extensions. |
|
| 26 | + * |
|
| 27 | + * @return Map |
|
| 28 | + */ |
|
| 29 | + public function getExtensions() |
|
| 30 | + { |
|
| 31 | + return $this->extensions; |
|
| 32 | + } |
|
| 33 | 33 | } |
@@ -8,37 +8,37 @@ |
||
| 8 | 8 | |
| 9 | 9 | trait TagsPart |
| 10 | 10 | { |
| 11 | - private $tags; |
|
| 11 | + private $tags; |
|
| 12 | 12 | |
| 13 | - private function parseTags(Map $data) |
|
| 14 | - { |
|
| 15 | - $this->tags = new ArrayList(); |
|
| 16 | - foreach ($data->get('tags', []) as $t) { |
|
| 17 | - $this->tags->add(new Tag($t)); |
|
| 18 | - } |
|
| 19 | - } |
|
| 13 | + private function parseTags(Map $data) |
|
| 14 | + { |
|
| 15 | + $this->tags = new ArrayList(); |
|
| 16 | + foreach ($data->get('tags', []) as $t) { |
|
| 17 | + $this->tags->add(new Tag($t)); |
|
| 18 | + } |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * Return tags. |
|
| 23 | - * |
|
| 24 | - * @return ArrayList |
|
| 25 | - */ |
|
| 26 | - public function getTags() |
|
| 27 | - { |
|
| 28 | - return $this->tags; |
|
| 29 | - } |
|
| 21 | + /** |
|
| 22 | + * Return tags. |
|
| 23 | + * |
|
| 24 | + * @return ArrayList |
|
| 25 | + */ |
|
| 26 | + public function getTags() |
|
| 27 | + { |
|
| 28 | + return $this->tags; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - protected function exportTags() |
|
| 32 | - { |
|
| 33 | - $out = []; |
|
| 34 | - foreach ($this->tags as $tag) { |
|
| 35 | - if ($tag->isObject()) { |
|
| 36 | - $out[] = $tag->toArray(); |
|
| 37 | - } else { |
|
| 38 | - $out[] = $tag->getName(); |
|
| 39 | - } |
|
| 40 | - } |
|
| 31 | + protected function exportTags() |
|
| 32 | + { |
|
| 33 | + $out = []; |
|
| 34 | + foreach ($this->tags as $tag) { |
|
| 35 | + if ($tag->isObject()) { |
|
| 36 | + $out[] = $tag->toArray(); |
|
| 37 | + } else { |
|
| 38 | + $out[] = $tag->getName(); |
|
| 39 | + } |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - return $out; |
|
| 43 | - } |
|
| 42 | + return $out; |
|
| 43 | + } |
|
| 44 | 44 | } |