@@ -163,7 +163,7 @@ class OptionsResolver implements Options
163163 *
164164 * @throws AccessException If called from a lazy option or normalizer
165165 */
166- public function setDefault ($ option , $ value )
166+ public function setDefault (string $ option , $ value )
167167 {
168168 // Setting is not possible once resolving starts, because then lazy
169169 // options could manipulate the state of the object, leading to
@@ -257,7 +257,7 @@ public function setDefaults(array $defaults)
257257 *
258258 * @return bool Whether a default value is set
259259 */
260- public function hasDefault ($ option )
260+ public function hasDefault (string $ option )
261261 {
262262 return \array_key_exists ($ option , $ this ->defaults );
263263 }
@@ -294,7 +294,7 @@ public function setRequired($optionNames)
294294 *
295295 * @return bool Whether the option is required
296296 */
297- public function isRequired ($ option )
297+ public function isRequired (string $ option )
298298 {
299299 return isset ($ this ->required [$ option ]);
300300 }
@@ -322,7 +322,7 @@ public function getRequiredOptions()
322322 *
323323 * @return bool Whether the option is missing
324324 */
325- public function isMissing ($ option )
325+ public function isMissing (string $ option )
326326 {
327327 return isset ($ this ->required [$ option ]) && !\array_key_exists ($ option , $ this ->defaults );
328328 }
@@ -375,7 +375,7 @@ public function setDefined($optionNames)
375375 *
376376 * @return bool Whether the option is defined
377377 */
378- public function isDefined ($ option )
378+ public function isDefined (string $ option )
379379 {
380380 return isset ($ this ->defined [$ option ]);
381381 }
@@ -474,7 +474,7 @@ public function isDeprecated(string $option): bool
474474 * @throws UndefinedOptionsException If the option is undefined
475475 * @throws AccessException If called from a lazy option or normalizer
476476 */
477- public function setNormalizer ($ option , \Closure $ normalizer )
477+ public function setNormalizer (string $ option , \Closure $ normalizer )
478478 {
479479 if ($ this ->locked ) {
480480 throw new AccessException ('Normalizers cannot be set from a lazy option or normalizer. ' );
@@ -562,7 +562,7 @@ public function addNormalizer(string $option, \Closure $normalizer, bool $forceP
562562 * @throws UndefinedOptionsException If the option is undefined
563563 * @throws AccessException If called from a lazy option or normalizer
564564 */
565- public function setAllowedValues ($ option , $ allowedValues )
565+ public function setAllowedValues (string $ option , $ allowedValues )
566566 {
567567 if ($ this ->locked ) {
568568 throw new AccessException ('Allowed values cannot be set from a lazy option or normalizer. ' );
@@ -603,7 +603,7 @@ public function setAllowedValues($option, $allowedValues)
603603 * @throws UndefinedOptionsException If the option is undefined
604604 * @throws AccessException If called from a lazy option or normalizer
605605 */
606- public function addAllowedValues ($ option , $ allowedValues )
606+ public function addAllowedValues (string $ option , $ allowedValues )
607607 {
608608 if ($ this ->locked ) {
609609 throw new AccessException ('Allowed values cannot be added from a lazy option or normalizer. ' );
@@ -644,7 +644,7 @@ public function addAllowedValues($option, $allowedValues)
644644 * @throws UndefinedOptionsException If the option is undefined
645645 * @throws AccessException If called from a lazy option or normalizer
646646 */
647- public function setAllowedTypes ($ option , $ allowedTypes )
647+ public function setAllowedTypes (string $ option , $ allowedTypes )
648648 {
649649 if ($ this ->locked ) {
650650 throw new AccessException ('Allowed types cannot be set from a lazy option or normalizer. ' );
@@ -679,7 +679,7 @@ public function setAllowedTypes($option, $allowedTypes)
679679 * @throws UndefinedOptionsException If the option is undefined
680680 * @throws AccessException If called from a lazy option or normalizer
681681 */
682- public function addAllowedTypes ($ option , $ allowedTypes )
682+ public function addAllowedTypes (string $ option , $ allowedTypes )
683683 {
684684 if ($ this ->locked ) {
685685 throw new AccessException ('Allowed types cannot be added from a lazy option or normalizer. ' );
0 commit comments