1 | <?php |
||
13 | class ArgumentDefinition |
||
14 | { |
||
15 | /** |
||
16 | * Name of argument |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $name; |
||
21 | |||
22 | /** |
||
23 | * Type of argument |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $type; |
||
28 | |||
29 | /** |
||
30 | * Description of argument |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $description; |
||
35 | |||
36 | /** |
||
37 | * Is argument required? |
||
38 | * |
||
39 | * @var boolean |
||
40 | */ |
||
41 | protected $required = false; |
||
42 | |||
43 | /** |
||
44 | * Default value for argument |
||
45 | * |
||
46 | * @var mixed |
||
47 | */ |
||
48 | protected $defaultValue = null; |
||
49 | |||
50 | /** |
||
51 | * Constructor for this argument definition. |
||
52 | * |
||
53 | * @param string $name Name of argument |
||
54 | * @param string $type Type of argument |
||
55 | * @param string $description Description of argument |
||
56 | * @param boolean $required TRUE if argument is required |
||
57 | * @param mixed $defaultValue Default value |
||
58 | */ |
||
59 | public function __construct(string $name, string $type, string $description, bool $required, $defaultValue = null) |
||
67 | |||
68 | /** |
||
69 | * Get the name of the argument |
||
70 | * |
||
71 | * @return string Name of argument |
||
72 | */ |
||
73 | public function getName(): string |
||
77 | |||
78 | /** |
||
79 | * Get the type of the argument |
||
80 | * |
||
81 | * @return string Type of argument |
||
82 | */ |
||
83 | public function getType(): string |
||
87 | |||
88 | /** |
||
89 | * Get the description of the argument |
||
90 | * |
||
91 | * @return string Description of argument |
||
92 | */ |
||
93 | public function getDescription(): string |
||
97 | |||
98 | /** |
||
99 | * Get the optionality of the argument |
||
100 | * |
||
101 | * @return boolean TRUE if argument is optional |
||
102 | */ |
||
103 | public function isRequired(): bool |
||
107 | |||
108 | /** |
||
109 | * Get the default value, if set |
||
110 | * |
||
111 | * @return mixed Default value |
||
112 | */ |
||
113 | public function getDefaultValue() |
||
117 | } |
||
118 |