@@ -163,7 +163,7 @@ class OptionsResolver implements Options
163
163
*
164
164
* @throws AccessException If called from a lazy option or normalizer
165
165
*/
166
- public function setDefault ($ option , $ value )
166
+ public function setDefault (string $ option , $ value )
167
167
{
168
168
// Setting is not possible once resolving starts, because then lazy
169
169
// options could manipulate the state of the object, leading to
@@ -257,7 +257,7 @@ public function setDefaults(array $defaults)
257
257
*
258
258
* @return bool Whether a default value is set
259
259
*/
260
- public function hasDefault ($ option )
260
+ public function hasDefault (string $ option )
261
261
{
262
262
return \array_key_exists ($ option , $ this ->defaults );
263
263
}
@@ -294,7 +294,7 @@ public function setRequired($optionNames)
294
294
*
295
295
* @return bool Whether the option is required
296
296
*/
297
- public function isRequired ($ option )
297
+ public function isRequired (string $ option )
298
298
{
299
299
return isset ($ this ->required [$ option ]);
300
300
}
@@ -322,7 +322,7 @@ public function getRequiredOptions()
322
322
*
323
323
* @return bool Whether the option is missing
324
324
*/
325
- public function isMissing ($ option )
325
+ public function isMissing (string $ option )
326
326
{
327
327
return isset ($ this ->required [$ option ]) && !\array_key_exists ($ option , $ this ->defaults );
328
328
}
@@ -375,7 +375,7 @@ public function setDefined($optionNames)
375
375
*
376
376
* @return bool Whether the option is defined
377
377
*/
378
- public function isDefined ($ option )
378
+ public function isDefined (string $ option )
379
379
{
380
380
return isset ($ this ->defined [$ option ]);
381
381
}
@@ -474,7 +474,7 @@ public function isDeprecated(string $option): bool
474
474
* @throws UndefinedOptionsException If the option is undefined
475
475
* @throws AccessException If called from a lazy option or normalizer
476
476
*/
477
- public function setNormalizer ($ option , \Closure $ normalizer )
477
+ public function setNormalizer (string $ option , \Closure $ normalizer )
478
478
{
479
479
if ($ this ->locked ) {
480
480
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
562
562
* @throws UndefinedOptionsException If the option is undefined
563
563
* @throws AccessException If called from a lazy option or normalizer
564
564
*/
565
- public function setAllowedValues ($ option , $ allowedValues )
565
+ public function setAllowedValues (string $ option , $ allowedValues )
566
566
{
567
567
if ($ this ->locked ) {
568
568
throw new AccessException ('Allowed values cannot be set from a lazy option or normalizer. ' );
@@ -603,7 +603,7 @@ public function setAllowedValues($option, $allowedValues)
603
603
* @throws UndefinedOptionsException If the option is undefined
604
604
* @throws AccessException If called from a lazy option or normalizer
605
605
*/
606
- public function addAllowedValues ($ option , $ allowedValues )
606
+ public function addAllowedValues (string $ option , $ allowedValues )
607
607
{
608
608
if ($ this ->locked ) {
609
609
throw new AccessException ('Allowed values cannot be added from a lazy option or normalizer. ' );
@@ -644,7 +644,7 @@ public function addAllowedValues($option, $allowedValues)
644
644
* @throws UndefinedOptionsException If the option is undefined
645
645
* @throws AccessException If called from a lazy option or normalizer
646
646
*/
647
- public function setAllowedTypes ($ option , $ allowedTypes )
647
+ public function setAllowedTypes (string $ option , $ allowedTypes )
648
648
{
649
649
if ($ this ->locked ) {
650
650
throw new AccessException ('Allowed types cannot be set from a lazy option or normalizer. ' );
@@ -679,7 +679,7 @@ public function setAllowedTypes($option, $allowedTypes)
679
679
* @throws UndefinedOptionsException If the option is undefined
680
680
* @throws AccessException If called from a lazy option or normalizer
681
681
*/
682
- public function addAllowedTypes ($ option , $ allowedTypes )
682
+ public function addAllowedTypes (string $ option , $ allowedTypes )
683
683
{
684
684
if ($ this ->locked ) {
685
685
throw new AccessException ('Allowed types cannot be added from a lazy option or normalizer. ' );
0 commit comments