| 1 | <?php declare(strict_types = 1); |
||
| 16 | class Parameter implements Element |
||
| 17 | { |
||
| 18 | use VisiteeMixin; |
||
| 19 | |||
| 20 | const IN_BODY = 'body'; |
||
| 21 | const IN_PATH = 'path'; |
||
| 22 | const IN_QUERY = 'query'; |
||
| 23 | const IN_HEADER = 'header'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $name; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var bool |
||
| 32 | */ |
||
| 33 | protected $required = false; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var string|null |
||
| 37 | */ |
||
| 38 | protected $collectionFormat; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @var Schema |
||
| 42 | */ |
||
| 43 | protected $schema; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @var string |
||
| 47 | */ |
||
| 48 | protected $in; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Parameter constructor. |
||
| 52 | * |
||
| 53 | * @param string $name |
||
| 54 | * @param bool $required |
||
| 55 | * @param Schema $schema |
||
| 56 | * @param string $in |
||
| 57 | * @param string $collectionFormat |
||
| 58 | */ |
||
| 59 | public function __construct(string $name, bool $required, Schema $schema, string $in, $collectionFormat = null) |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @return string |
||
| 70 | */ |
||
| 71 | public function getName(): string |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @return bool |
||
| 78 | */ |
||
| 79 | public function isRequired(): bool |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @return string|null |
||
| 86 | */ |
||
| 87 | public function getCollectionFormat() |
||
| 91 | |||
| 92 | /** |
||
| 93 | * @return Schema |
||
| 94 | */ |
||
| 95 | public function getSchema(): Schema |
||
| 99 | |||
| 100 | /** |
||
| 101 | * @return string |
||
| 102 | */ |
||
| 103 | public function getIn(): string |
||
| 107 | } |
||
| 108 |