apie-lib /
openapi-schema
| 1 | <?php |
||
| 2 | |||
| 3 | |||
| 4 | namespace Apie\OpenapiSchema\Spec; |
||
| 5 | |||
| 6 | use Apie\CommonValueObjects\Url; |
||
| 7 | use Apie\OpenapiSchema\Concerns\CompositeValueObjectWithExtension; |
||
| 8 | use Apie\OpenapiSchema\Exceptions\ExampleValueAndExternalValueAreMutuallyExclusive; |
||
| 9 | use Apie\OpenapiSchema\ValueObjects\SpecificationExtension; |
||
| 10 | use Apie\ValueObjects\ValueObjectInterface; |
||
| 11 | |||
| 12 | class Example implements ValueObjectInterface |
||
| 13 | { |
||
| 14 | use CompositeValueObjectWithExtension; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 15 | |||
| 16 | /** |
||
| 17 | * @var string|null |
||
| 18 | */ |
||
| 19 | private $summary; |
||
|
0 ignored issues
–
show
|
|||
| 20 | |||
| 21 | /** |
||
| 22 | * @var string|null |
||
| 23 | */ |
||
| 24 | private $description; |
||
|
0 ignored issues
–
show
|
|||
| 25 | |||
| 26 | /** |
||
| 27 | * @var mixed|null |
||
| 28 | */ |
||
| 29 | private $value; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @var Url|null |
||
| 33 | */ |
||
| 34 | private $externalValue; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var SpecificationExtension |
||
| 38 | */ |
||
| 39 | private $specificationExtension; |
||
| 40 | |||
| 41 | public function __construct() |
||
| 42 | { |
||
| 43 | $this->specificationExtension = new SpecificationExtension([]); |
||
| 44 | } |
||
| 45 | |||
| 46 | private function validateProperties(): void |
||
| 47 | { |
||
| 48 | if (isset($this->value) && isset($this->externalValue)) { |
||
| 49 | throw new ExampleValueAndExternalValueAreMutuallyExclusive(); |
||
| 50 | } |
||
| 51 | } |
||
| 52 | } |
||
| 53 |