OptionConfigurator
in package
Table of Contents
- $name : mixed
- $resolver : mixed
- __construct() : mixed
- allowedTypes() : $this
- Adds allowed types for this option.
- allowedValues() : $this
- Sets allowed values for this option.
- default() : $this
- Sets the default value for this option.
- define() : self
- Defines an option configurator with the given name.
- deprecated() : $this
- Marks this option as deprecated.
- info() : $this
- Sets an info message for an option.
- normalize() : $this
- Sets the normalizer for this option.
- required() : $this
- Marks this option as required.
Properties
$name
private
mixed
$name
$resolver
private
mixed
$resolver
Methods
__construct()
public
__construct(string $name, OptionsResolver $resolver) : mixed
Parameters
- $name : string
- $resolver : OptionsResolver
Return values
mixed —allowedTypes()
Adds allowed types for this option.
public
allowedTypes(string ...$types) : $this
Parameters
- $types : string
-
One or more accepted types
Tags
Return values
$this —allowedValues()
Sets allowed values for this option.
public
allowedValues(mixed ...$values) : $this
Parameters
- $values : mixed
-
One or more acceptable values/closures
Tags
Return values
$this —default()
Sets the default value for this option.
public
default(mixed $value) : $this
Parameters
- $value : mixed
-
The default value of the option
Tags
Return values
$this —define()
Defines an option configurator with the given name.
public
define(string $option) : self
Parameters
- $option : string
Return values
self —deprecated()
Marks this option as deprecated.
public
deprecated(string $package, string $version[, string|Closure $message = 'The option "%name%" is deprecated.' ]) : $this
Parameters
- $package : string
-
The name of the composer package that is triggering the deprecation
- $version : string
-
The version of the package that introduced the deprecation
- $message : string|Closure = 'The option "%name%" is deprecated.'
-
The deprecation message to use
Return values
$this —info()
Sets an info message for an option.
public
info(string $info) : $this
Parameters
- $info : string
Tags
Return values
$this —normalize()
Sets the normalizer for this option.
public
normalize(Closure $normalizer) : $this
Parameters
- $normalizer : Closure
-
The normalizer
Tags
Return values
$this —required()
Marks this option as required.
public
required() : $this