| @@ 13-42 (lines=30) @@ | ||
| 10 | * @copyright 2014-2016 Martijn van der Lee |
|
| 11 | * @license https://opensource.org/licenses/MIT MIT |
|
| 12 | */ |
|
| 13 | class ParameterReference extends AbstractObject implements IParameter |
|
| 14 | { |
|
| 15 | ||
| 16 | private $reference = ''; |
|
| 17 | ||
| 18 | public function __construct(AbstractObject $parent, $reference) |
|
| 19 | { |
|
| 20 | parent::__construct($parent); |
|
| 21 | ||
| 22 | $this->reference = $reference; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function toArray() |
|
| 26 | { |
|
| 27 | return self::arrayFilterNull(array( |
|
| 28 | '$ref' => '#/parameters/' . $this->reference, |
|
| 29 | )); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function __toString() |
|
| 33 | { |
|
| 34 | return __CLASS__ . " {$this->reference}"; |
|
| 35 | } |
|
| 36 | ||
| 37 | public function getName() |
|
| 38 | { |
|
| 39 | return $this->reference; |
|
| 40 | } |
|
| 41 | ||
| 42 | } |
|
| 43 | ||
| @@ 13-37 (lines=25) @@ | ||
| 10 | * @copyright 2014-2016 Martijn van der Lee |
|
| 11 | * @license https://opensource.org/licenses/MIT MIT |
|
| 12 | */ |
|
| 13 | class ResponseReference extends AbstractObject |
|
| 14 | { |
|
| 15 | ||
| 16 | private $reference = ''; |
|
| 17 | ||
| 18 | public function __construct(AbstractObject $parent, $reference) |
|
| 19 | { |
|
| 20 | parent::__construct($parent); |
|
| 21 | ||
| 22 | $this->reference = $reference; |
|
| 23 | } |
|
| 24 | ||
| 25 | public function toArray() |
|
| 26 | { |
|
| 27 | return self::arrayFilterNull(array( |
|
| 28 | '$ref' => '#/responses/' . $this->reference, |
|
| 29 | )); |
|
| 30 | } |
|
| 31 | ||
| 32 | public function __toString() |
|
| 33 | { |
|
| 34 | return __CLASS__ . " {$this->reference}"; |
|
| 35 | } |
|
| 36 | ||
| 37 | } |
|
| 38 | ||