class DeltaMiddleware implements Middleware (View source)

Applies a set of user-customised modifications to config

Traits

Abstract flag-aware middleware

Properties

protected int $disableFlag

Disable flag

from  MiddlewareCommon
protected DeltaConfigCollection $collection

Source for deltas

Methods

public
$this
setDisableFlag(int $disableFlag)

Set flag to use to disable this middleware

public
int
getDisableFlag()

Get flag to use to disable this middleware

protected
bool
enabled(int|true $excludeMiddleware)

Check if this middlware is enabled

public
array
__serialize()

No description

public
void
__unserialize(array $data)

No description

public
string
serialize() deprecated

The __serialize() magic method will be automatically used instead of this

public
unserialize(string $serialized) deprecated

The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0

public
__construct(DeltaConfigCollection $collection, int $disableFlag = 0)

DeltaMiddleware constructor.

public
getCollection()

No description

public
$this
setCollection(DeltaConfigCollection $collection)

No description

public
array
getClassConfig(string $class, int|true $excludeMiddleware, callable $next)

Get config for a class

protected
array
applyDelta(array $config, array $delta)

Apply a single delta to a class config

Details

$this setDisableFlag(int $disableFlag)

Set flag to use to disable this middleware

Parameters

int $disableFlag

Return Value

$this

int getDisableFlag()

Get flag to use to disable this middleware

Return Value

int

protected bool enabled(int|true $excludeMiddleware)

Check if this middlware is enabled

Parameters

int|true $excludeMiddleware

Return Value

bool

array __serialize()

No description

Return Value

array

void __unserialize(array $data)

No description

Parameters

array $data

Return Value

void

string serialize() deprecated

deprecated 1.12.0 Will be replaced with __serialize()

The __serialize() magic method will be automatically used instead of this

Return Value

string

unserialize(string $serialized) deprecated

deprecated 1.12.0 Will be replaced with __unserialize()

The __unserialize() magic method will be automatically used instead of this almost all the time This method will be automatically used if existing serialized data was not saved as an associative array and the PHP version used in less than PHP 9.0

Parameters

string $serialized

__construct(DeltaConfigCollection $collection, int $disableFlag = 0)

DeltaMiddleware constructor.

Parameters

DeltaConfigCollection $collection
int $disableFlag

DeltaConfigCollection getCollection()

No description

Return Value

DeltaConfigCollection

$this setCollection(DeltaConfigCollection $collection)

No description

Parameters

DeltaConfigCollection $collection

Return Value

$this

array getClassConfig(string $class, int|true $excludeMiddleware, callable $next)

Get config for a class

Parameters

string $class

Name of class

int|true $excludeMiddleware

Middleware disable flags

callable $next

Callback to next middleware

Return Value

array

Complete class config

protected array applyDelta(array $config, array $delta)

Apply a single delta to a class config

Parameters

array $config
array $delta

Return Value

array