@@ -63,13 +63,17 @@ public function __construct()
63
63
*
64
64
* - function (Options $options)
65
65
* - function (Options $options, $previousValue)
66
+ *
67
+ * @return OptionsResolver The resolver instance.
66
68
*/
67
69
public function setDefaults (array $ defaultValues )
68
70
{
69
71
foreach ($ defaultValues as $ option => $ value ) {
70
72
$ this ->defaultOptions [$ option ] = $ value ;
71
73
$ this ->knownOptions [$ option ] = true ;
72
74
}
75
+
76
+ return $ this ;
73
77
}
74
78
75
79
/**
@@ -85,6 +89,8 @@ public function setDefaults(array $defaultValues)
85
89
* of the following signature:
86
90
*
87
91
* - function (Options $options)
92
+ *
93
+ * @return OptionsResolver The resolver instance.
88
94
*/
89
95
public function replaceDefaults (array $ defaultValues )
90
96
{
@@ -93,6 +99,8 @@ public function replaceDefaults(array $defaultValues)
93
99
$ this ->defaultOptions [$ option ] = $ value ;
94
100
$ this ->knownOptions [$ option ] = true ;
95
101
}
102
+
103
+ return $ this ;
96
104
}
97
105
98
106
/**
@@ -105,6 +113,8 @@ public function replaceDefaults(array $defaultValues)
105
113
*
106
114
* @param array $optionNames A list of option names.
107
115
*
116
+ * @return OptionsResolver The resolver instance.
117
+ *
108
118
* @throws OptionDefinitionException When trying to pass default values.
109
119
*/
110
120
public function setOptional (array $ optionNames )
@@ -116,6 +126,8 @@ public function setOptional(array $optionNames)
116
126
117
127
$ this ->knownOptions [$ option ] = true ;
118
128
}
129
+
130
+ return $ this ;
119
131
}
120
132
121
133
/**
@@ -125,6 +137,8 @@ public function setOptional(array $optionNames)
125
137
*
126
138
* @param array $optionNames A list of option names.
127
139
*
140
+ * @return OptionsResolver The resolver instance.
141
+ *
128
142
* @throws OptionDefinitionException When trying to pass default values.
129
143
*/
130
144
public function setRequired (array $ optionNames )
@@ -137,6 +151,8 @@ public function setRequired(array $optionNames)
137
151
$ this ->knownOptions [$ option ] = true ;
138
152
$ this ->requiredOptions [$ option ] = true ;
139
153
}
154
+
155
+ return $ this ;
140
156
}
141
157
142
158
/**
@@ -146,6 +162,8 @@ public function setRequired(array $optionNames)
146
162
* with values acceptable for that option as
147
163
* values.
148
164
*
165
+ * @return OptionsResolver The resolver instance.
166
+ *
149
167
* @throws InvalidOptionsException If an option has not been defined for
150
168
* which an allowed value is set.
151
169
*/
@@ -154,6 +172,8 @@ public function setAllowedValues(array $allowedValues)
154
172
$ this ->validateOptionNames (array_keys ($ allowedValues ));
155
173
156
174
$ this ->allowedValues = array_replace ($ this ->allowedValues , $ allowedValues );
175
+
176
+ return $ this ;
157
177
}
158
178
159
179
/**
@@ -165,6 +185,8 @@ public function setAllowedValues(array $allowedValues)
165
185
* with values acceptable for that option as
166
186
* values.
167
187
*
188
+ * @return OptionsResolver The resolver instance.
189
+ *
168
190
* @throws InvalidOptionsException If an option has not been defined for
169
191
* which an allowed value is set.
170
192
*/
@@ -173,6 +195,8 @@ public function addAllowedValues(array $allowedValues)
173
195
$ this ->validateOptionNames (array_keys ($ allowedValues ));
174
196
175
197
$ this ->allowedValues = array_merge_recursive ($ this ->allowedValues , $ allowedValues );
198
+
199
+ return $ this ;
176
200
}
177
201
178
202
/**
0 commit comments