Skip to content

Cardinality

Rasuvaeff\Understudy\Cardinality

ClassPackage: rasuvaeff/understudySourceVersion: v0.4.1

How many times a call is allowed to happen. null as the maximum means no upper bound.

Constructor

php
__construct(
    int<0, max> $minimum,
    int<0, max>|null $maximum,
)
ParameterTypeDefaultDescription
$minimumint<0, max>required
$maximumint<0, max>|nullrequired

Methods

exactly()

php
static exactly(int $times): self

atLeast()

php
static atLeast(int $minimum): self

between()

php
static between(int $minimum, ?int $maximum): self

any()

php
static any(): self

Any number of calls, including none.

never()

php
static never(): self

allows()

php
allows(int<0, max> $count): bool

describe()

php
describe(): string