Documentation

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

Methods

allowedTypes()

Adds allowed types for this option.

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

One or more accepted types

Tags
throws
AccessException

If called from a lazy option or normalizer

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
throws
AccessException

If called from a lazy option or normalizer

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
throws
AccessException

If called from a lazy option or normalizer

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
throws
AccessException

If called from a lazy option or normalizer

Return values
$this

normalize()

Sets the normalizer for this option.

public normalize(Closure $normalizer) : $this
Parameters
$normalizer : Closure

The normalizer

Tags
throws
AccessException

If called from a lazy option or normalizer

Return values
$this

required()

Marks this option as required.

public required() : $this
Tags
throws
AccessException

If called from a lazy option or normalizer

Return values
$this

Search results