PHP Класс Zumba\Swivel\Builder

Наследование: implements Zumba\Swivel\BuilderInterface, use trait Psr\Log\LoggerAwareTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$args array Arguments to be passed to the behavior.
$behavior Behavior The behavior to be executed.
$bucket Zumba\Swivel\BucketInterface The user's Bucket.
$defaultWaived boolean Whether this feature requires a default behavior.
$metrics Zumba\Swivel\MetricsInterface A Metrics object.
$slug string Parent Feature slug.

Открытые методы

Метод Описание
__construct ( string $slug, Zumba\Swivel\BucketInterface $bucket ) Zumba\Swivel\Builder.
addBehavior ( string $slug, mixed $strategy, array $args = [] ) : Zumba\Swivel\BuilderInterface Add a behavior to be executed later.
addValue ( string $slug, mixed $value ) : Zumba\Swivel\BuilderInterface Add a value to be returned when the builder is executed.
defaultBehavior ( callable $strategy, array $args = [] ) : Zumba\Swivel\BuilderInterface Add a default behavior.
defaultValue ( mixed $value ) : Zumba\Swivel\BuilderInterface Add a default value.
execute ( ) : mixed Execute the feature.
getBehavior ( string $slug, callable $strategy = self::DEFAULT_STRATEGY ) : Zumba\Swivel\BehaviorInterface Create and return a new Behavior.
noDefault ( ) : Zumba\Swivel\BuilderInterface Waive the default behavior for this feature.
setMetrics ( Zumba\Swivel\MetricsInterface $metrics ) Set a metrics object.

Защищенные методы

Метод Описание
setBehavior ( Behavior $behavior, array $args = [] ) Set the behavior and it's args.
startMetrics ( string $behaviorSlug ) Start collecting metrics about this feature.
stopMetrics ( string $behaviorSlug ) Stop collecting metrics about this feature.

Описание методов

__construct() публичный Метод

Zumba\Swivel\Builder.
public __construct ( string $slug, Zumba\Swivel\BucketInterface $bucket )
$slug string
$bucket Zumba\Swivel\BucketInterface

addBehavior() публичный Метод

Behavior will only be added if it is enabled for the user's bucket.
public addBehavior ( string $slug, mixed $strategy, array $args = [] ) : Zumba\Swivel\BuilderInterface
$slug string
$strategy mixed
$args array
Результат Zumba\Swivel\BuilderInterface

addValue() публичный Метод

Value will only be returned if it is enabled for the user's bucket.
public addValue ( string $slug, mixed $value ) : Zumba\Swivel\BuilderInterface
$slug string
$value mixed
Результат Zumba\Swivel\BuilderInterface

defaultBehavior() публичный Метод

Will be used if all other behaviors and values are not enabled for the user's bucket.
public defaultBehavior ( callable $strategy, array $args = [] ) : Zumba\Swivel\BuilderInterface
$strategy callable
$args array
Результат Zumba\Swivel\BuilderInterface

defaultValue() публичный Метод

Will be used if all other behaviors and values are not enabled for the user's bucket.
public defaultValue ( mixed $value ) : Zumba\Swivel\BuilderInterface
$value mixed
Результат Zumba\Swivel\BuilderInterface

execute() публичный Метод

Execute the feature.
public execute ( ) : mixed
Результат mixed

getBehavior() публичный Метод

The $strategy parameter must be a valid callable.
public getBehavior ( string $slug, callable $strategy = self::DEFAULT_STRATEGY ) : Zumba\Swivel\BehaviorInterface
$slug string
$strategy callable
Результат Zumba\Swivel\BehaviorInterface

noDefault() публичный Метод

Waive the default behavior for this feature.
public noDefault ( ) : Zumba\Swivel\BuilderInterface
Результат Zumba\Swivel\BuilderInterface

setBehavior() защищенный Метод

Set the behavior and it's args.
protected setBehavior ( Behavior $behavior, array $args = [] )
$behavior Behavior
$args array

setMetrics() публичный Метод

Set a metrics object.
public setMetrics ( Zumba\Swivel\MetricsInterface $metrics )
$metrics Zumba\Swivel\MetricsInterface

startMetrics() защищенный Метод

Start collecting metrics about this feature.
protected startMetrics ( string $behaviorSlug )
$behaviorSlug string

stopMetrics() защищенный Метод

Stop collecting metrics about this feature.
protected stopMetrics ( string $behaviorSlug )
$behaviorSlug string

Описание свойств

$args защищенное свойство

Arguments to be passed to the behavior.
protected array $args
Результат array

$behavior защищенное свойство

The behavior to be executed.
protected Behavior,Zumba\Swivel $behavior
Результат Behavior

$bucket защищенное свойство

The user's Bucket.
protected BucketInterface,Zumba\Swivel $bucket
Результат Zumba\Swivel\BucketInterface

$defaultWaived защищенное свойство

Whether this feature requires a default behavior.
protected bool $defaultWaived
Результат boolean

$metrics защищенное свойство

A Metrics object.
protected MetricsInterface,Zumba\Swivel $metrics
Результат Zumba\Swivel\MetricsInterface

$slug защищенное свойство

Parent Feature slug.
protected string $slug
Результат string