Parameter.php 612 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace Knuckles\Camel\Output;
  3. class Parameter extends \Knuckles\Camel\Extraction\Parameter
  4. {
  5. /** @var string */
  6. public string $name;
  7. /** @var string|null */
  8. public ?string $description = null;
  9. /** @var bool */
  10. public bool $required = false;
  11. public $example = null;
  12. /** @var string */
  13. public string $type = 'string';
  14. /** @var array */
  15. public $__fields = [];
  16. public function toArray(): array
  17. {
  18. if (empty($this->exceptKeys)) {
  19. return $this->except('__fields')->toArray();
  20. }
  21. return parent::toArray();
  22. }
  23. }