1 | <?php |
||
15 | class Argument |
||
16 | { |
||
17 | /** |
||
18 | * The name |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $name; |
||
23 | |||
24 | /** |
||
25 | * The value |
||
26 | * |
||
27 | * @var mixed |
||
28 | */ |
||
29 | protected $value; |
||
30 | |||
31 | /** |
||
32 | * Create process argument object |
||
33 | * |
||
34 | * @param string $name |
||
35 | * @param mixed $value |
||
36 | */ |
||
37 | 18 | public function __construct($name, $value = null) |
|
42 | |||
43 | /** |
||
44 | * Create process argument object from string |
||
45 | * |
||
46 | * @param string $argument |
||
47 | * |
||
48 | * @return $this |
||
49 | */ |
||
50 | 6 | public static function fromString($argument) |
|
61 | |||
62 | /** |
||
63 | * Return process argument as string |
||
64 | * |
||
65 | * @return string |
||
66 | */ |
||
67 | 6 | public function toString() |
|
75 | |||
76 | /** |
||
77 | * Get name |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | 18 | public function getName() |
|
85 | |||
86 | /** |
||
87 | * Whether the argument has a value |
||
88 | * |
||
89 | * @return bool |
||
90 | */ |
||
91 | 6 | public function hasValue() |
|
95 | |||
96 | /** |
||
97 | * Get value |
||
98 | * |
||
99 | * @return mixed |
||
100 | */ |
||
101 | 15 | public function getValue() |
|
105 | |||
106 | /** |
||
107 | * Set value |
||
108 | * |
||
109 | * @param mixed $value |
||
110 | * |
||
111 | * @return $this |
||
112 | */ |
||
113 | 3 | public function setValue($value) |
|
119 | } |
||
120 |