PendingScopedFeatureInteraction
class PendingScopedFeatureInteraction
Properties
| protected Decorator | $driver | The feature driver. |
|
| protected mixed[] | $scope | The feature interaction scope. |
Methods
Add scope to the feature interaction.
Load the feature into memory.
Load the missing features into memory.
Load all defined features into memory.
Get the value of the flag.
Get the values of the flag.
Retrieve all the features and their values.
Determine if the feature is active.
Determine if all the features are active.
Determine if any of the features are active.
Determine if the feature is inactive.
Determine if all the features are inactive.
Determine if any of the features are inactive.
Activate the feature.
Deactivate the feature.
Forget the flags value.
Load the missing values of the given features before they are read one at a time.
Normalize the given features to their scalar names.
The scope to pass to the driver.
Details
at line 31
__construct(Decorator $driver)
Create a new Pending Scoped Feature Interaction instance.
at line 41
PendingScopedFeatureInteraction
for(mixed $scope)
Add scope to the feature interaction.
at line 55
array
load(UnitEnum|string|array $features)
Load the feature into memory.
at line 71
array
loadMissing(UnitEnum|string|array $features)
Load the missing features into memory.
at line 88
array
loadAll()
Load all defined features into memory.
Each scope loads only the features whose resolvers accept it.
at line 105
mixed
value(UnitEnum|string $feature)
Get the value of the flag.
at line 116
array
values(array $features)
Get the values of the flag.
at line 141
array
all()
Retrieve all the features and their values.
at line 151
bool
active(UnitEnum|string $feature)
Determine if the feature is active.
at line 161
bool
allAreActive(array $features)
Determine if all the features are active.
at line 183
bool
someAreActive(array $features)
Determine if any of the features are active.
at line 205
bool
inactive(UnitEnum|string $feature)
Determine if the feature is inactive.
at line 215
bool
allAreInactive(array $features)
Determine if all the features are inactive.
at line 237
bool
someAreInactive(array $features)
Determine if any of the features are inactive.
at line 259
mixed
when(UnitEnum|string $feature, Closure $whenActive, Closure|null $whenInactive = null)
Apply the callback if the feature is active.
at line 275
mixed
unless(UnitEnum|string $feature, Closure $whenInactive, Closure|null $whenActive = null)
Apply the callback if the feature is inactive.
at line 285
void
activate(UnitEnum|string|array $feature, mixed $value = true)
Activate the feature.
at line 303
void
deactivate(UnitEnum|string|array $feature)
Deactivate the feature.
at line 321
void
forget(UnitEnum|string|array $features)
Forget the flags value.
at line 337
protected void
loadMissingBeforeReading(array $features)
Load the missing values of the given features before they are read one at a time.
A single feature and scope is left to the read itself, which loads it the same way.
at line 350
protected array
normalize(UnitEnum|string|array $features)
Normalize the given features to their scalar names.
at line 360
protected array
scope()
The scope to pass to the driver.