\Symfony\Component\OptionsResolverOptionConfigurator

Summary

Methods
Properties
Constants
__construct()
allowedTypes()
allowedValues()
default()
define()
deprecated()
normalize()
required()
info()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$name
$resolver
N/A

Properties

$name

$name

$resolver

$resolver

Methods

__construct()

__construct(string  $name, \Symfony\Component\OptionsResolver\OptionsResolver  $resolver) : mixed

Parameters

string $name
\Symfony\Component\OptionsResolver\OptionsResolver $resolver

Returns

mixed —

allowedTypes()

allowedTypes(string  ...$types) : $this

Adds allowed types for this option.

Parameters

string $types variadic

One or more accepted types

Throws

\Symfony\Component\OptionsResolver\Exception\AccessException

If called from a lazy option or normalizer

Returns

$this —

allowedValues()

allowedValues(mixed  ...$values) : $this

Sets allowed values for this option.

Parameters

mixed $values variadic

One or more acceptable values/closures

Throws

\Symfony\Component\OptionsResolver\Exception\AccessException

If called from a lazy option or normalizer

Returns

$this —

default()

default(mixed  $value) : $this

Sets the default value for this option.

Parameters

mixed $value

The default value of the option

Throws

\Symfony\Component\OptionsResolver\Exception\AccessException

If called from a lazy option or normalizer

Returns

$this —

define()

define(string  $option) : self

Defines an option configurator with the given name.

Parameters

string $option

Returns

self —

deprecated()

deprecated(string  $package, string  $version, string|\Closure  $message = 'The option "%name%" is deprecated.') : $this

Marks this option as deprecated.

Parameters

string $package

The name of the composer package that is triggering the deprecation

string $version

The version of the package that introduced the deprecation

string|\Closure $message

The deprecation message to use

Returns

$this —

normalize()

normalize(\Closure  $normalizer) : $this

Sets the normalizer for this option.

Parameters

\Closure $normalizer

The normalizer

Throws

\Symfony\Component\OptionsResolver\Exception\AccessException

If called from a lazy option or normalizer

Returns

$this —

required()

required() : $this

Marks this option as required.

Throws

\Symfony\Component\OptionsResolver\Exception\AccessException

If called from a lazy option or normalizer

Returns

$this —

info()

info(string  $info) : $this

Sets an info message for an option.

Parameters

string $info

Throws

\Symfony\Component\OptionsResolver\Exception\AccessException

If called from a lazy option or normalizer

Returns

$this —