| 1 | <?php |
||
| 5 | class ArgumentDescription |
||
| 6 | { |
||
| 7 | const TYPE_ARRAY = 'array'; |
||
| 8 | const TYPE_SCALAR = 'scalar'; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | private $name; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var int |
||
| 17 | */ |
||
| 18 | private $position; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | private $type; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var bool |
||
| 27 | */ |
||
| 28 | private $required; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var mixed |
||
| 32 | */ |
||
| 33 | private $defaultValue; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Constructor. |
||
| 37 | * |
||
| 38 | * @param string $name |
||
| 39 | * @param int $position |
||
| 40 | * @param string $type |
||
| 41 | * @param bool $required |
||
| 42 | * @param mixed $defaultValue |
||
| 43 | */ |
||
| 44 | public function __construct($name, $position, $type, $required, $defaultValue = null) |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @return string |
||
| 55 | */ |
||
| 56 | public function getName() |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return int |
||
| 63 | */ |
||
| 64 | public function getPosition() |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @return string |
||
| 71 | */ |
||
| 72 | public function getType() |
||
| 76 | |||
| 77 | /** |
||
| 78 | * @return bool |
||
| 79 | */ |
||
| 80 | public function isRequired() |
||
| 84 | |||
| 85 | /** |
||
| 86 | * @return mixed |
||
| 87 | */ |
||
| 88 | public function getDefaultValue() |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @return bool |
||
| 95 | */ |
||
| 96 | public function isScalar() |
||
| 100 | } |
||
| 101 |