File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -123,8 +123,10 @@ protected function initFromSpecString($specString)
123
123
$ this ->short = $ short ;
124
124
$ this ->long = $ long ;
125
125
126
- // option is required.
127
- if (strpos ($ attributes , ': ' ) !== false ) {
126
+ if ($ attributes === null ) {
127
+ $ this ->flag ();
128
+ } else if (strpos ($ attributes , ': ' ) !== false ) {
129
+ // option is required.
128
130
$ this ->required ();
129
131
} else if (strpos ($ attributes , '+ ' ) !== false ) {
130
132
// option with multiple value
Original file line number Diff line number Diff line change @@ -195,11 +195,13 @@ public function keys()
195
195
return array_merge (array_keys ($ this ->longOptions ), array_keys ($ this ->shortOptions ));
196
196
}
197
197
198
+ #[\ReturnTypeWillChange]
198
199
public function count ()
199
200
{
200
201
return count ($ this ->data );
201
202
}
202
203
204
+ #[\ReturnTypeWillChange]
203
205
public function getIterator ()
204
206
{
205
207
return new ArrayIterator ($ this ->data );
Original file line number Diff line number Diff line change @@ -38,11 +38,13 @@ class OptionResult
38
38
/* arguments */
39
39
public $ arguments = array ();
40
40
41
+ #[\ReturnTypeWillChange]
41
42
public function getIterator ()
42
43
{
43
44
return new ArrayIterator ($ this ->keys );
44
45
}
45
46
47
+ #[\ReturnTypeWillChange]
46
48
public function count ()
47
49
{
48
50
return count ($ this ->keys );
@@ -106,21 +108,25 @@ public function getArguments()
106
108
return array_map (function ($ e ) { return $ e ->__toString (); }, $ this ->arguments );
107
109
}
108
110
111
+ #[\ReturnTypeWillChange]
109
112
public function offsetSet ($ name , $ value )
110
113
{
111
114
$ this ->keys [ $ name ] = $ value ;
112
115
}
113
116
117
+ #[\ReturnTypeWillChange]
114
118
public function offsetExists ($ name )
115
119
{
116
120
return isset ($ this ->keys [ $ name ]);
117
121
}
118
122
123
+ #[\ReturnTypeWillChange]
119
124
public function offsetGet ($ name )
120
125
{
121
126
return $ this ->keys [ $ name ];
122
127
}
123
128
129
+ #[\ReturnTypeWillChange]
124
130
public function offsetUnset ($ name )
125
131
{
126
132
unset($ this ->keys [$ name ]);
You can’t perform that action at this time.
0 commit comments