SlotFlow API Documentation

SlotRule
in package

FinalYes

Declarative include/exclude rule for shaping the valid slot space.

Tags
psalm-import-type

TSlotPattern from SlotSpace

Table of Contents

Properties

$allow  : bool
$attributes  : array<string, mixed>
$pattern  : string|array<string|int, mixed>|null

Methods

__construct()  : mixed
The pattern can be a string or an array of dimension-value pairs.
allow()  : self
Create an allow rule for the given pattern.
deny()  : self|RuleSet
Create a deny rule for the given pattern.
denyAll()  : array<int, SlotRule>
Create a list of allow rules for the given patterns.
meta()  : self
Return a copy of the rule with additional metadata attributes.

Properties

$attributes read-only

public array<string, mixed> $attributes = []

$pattern read-only

public string|array<string|int, mixed>|null $pattern

Methods

__construct()

The pattern can be a string or an array of dimension-value pairs.

public __construct(bool $allow, array<string|int, non-empty-string|null>|non-empty-string|null $pattern[, array<string|int, mixed> $attributes = [] ]) : mixed
Parameters
$allow : bool
$pattern : array<string|int, non-empty-string|null>|non-empty-string|null
$attributes : array<string|int, mixed> = []
Tags
psalm-param

TSlotPattern $pattern

allow()

Create an allow rule for the given pattern.

public static allow(array<non-empty-string, non-empty-string|null>|non-empty-string $pattern[, array<string, mixed> $meta = [] ]) : self

The pattern can be a string or an array of dimension-value pairs.

Parameters
$pattern : array<non-empty-string, non-empty-string|null>|non-empty-string
$meta : array<string, mixed> = []
Tags
psalm-param

TSlotPattern $pattern

Return values
self

deny()

Create a deny rule for the given pattern.

public static deny(array<non-empty-string, non-empty-string|null>|non-empty-string $pattern, array<non-empty-string, non-empty-string|null>|non-empty-string ...$patterns) : self|RuleSet

The pattern can be a string or an array of dimension-value pairs.

Parameters
$pattern : array<non-empty-string, non-empty-string|null>|non-empty-string
$patterns : array<non-empty-string, non-empty-string|null>|non-empty-string
Tags
psalm-param

TSlotPattern $pattern

psalm-param

list<TSlotPattern> $patterns

psalm-return

self|RuleSet

Return values
self|RuleSet

denyAll()

Create a list of allow rules for the given patterns.

public static denyAll(array<int, string|array<int|string, non-empty-string|null>> $patterns) : array<int, SlotRule>
Parameters
$patterns : array<int, string|array<int|string, non-empty-string|null>>
Tags
psalm-param

list<TSlotPattern> $patterns

Return values
array<int, SlotRule>

meta()

Return a copy of the rule with additional metadata attributes.

public meta(array<string, mixed> $attributes) : self

Existing attributes keep precedence over newly provided ones.

Parameters
$attributes : array<string, mixed>
Return values
self

        
On this page

Search results