final class CandidateCollection
    implements ArrayAccess<int, Candidate>, IteratorAggregate<int, Candidate>, Countable
Public API: explicitly declared with @visibility public.

The read-only candidate set for one observation.

Counting an empty candidate setdoctest
(new \Deriver\Deriver\Candidate\CandidateCollection([], new \Deriver\Deriver\Candidate\ResultRef('r')))->count() // => 0

Properties§

public ResultRef $reference
public Statistics $statistics = new \Deriver\Deriver\Candidate\Statistics()
public bool $interrupted = false

Methods§

public function __construct(
    private list<Candidate> $candidates,
    public ResultRef $reference,
    public Statistics $statistics = new \Deriver\Deriver\Candidate\Statistics(),
    public bool $interrupted = false,
)

Parameters

$candidateslist<Candidate>
$referenceResultRef
$statisticsStatistics
$interruptedbool
Calls 1
public function offsetExists(mixed $offset): bool

Tests whether an integer offset identifies a candidate.

Parameters

$offsetmixedOffset supplied through ArrayAccess

Returns

bool
Calls 1
public function offsetGet(mixed $offset): Candidate

Returns a candidate by its zero-based integer offset.

Parameters

$offsetmixedOffset supplied through ArrayAccess

Returns

Throws

OutOfBoundsException If the offset is not an integer or has no candidate
Calls 2
public function offsetSet(mixed $offset, mixed $value): void

Parameters

$offsetmixed
$valuemixed

Throws

RuntimeException Candidate collections cannot be changed
Calls 1
public function offsetUnset(mixed $offset): void

Parameters

$offsetmixed

Throws

RuntimeException Candidate collections cannot be changed
Calls 1
public function count(): int

Returns the number of concrete and partial candidate records.

Returns

int
Calls 1
public function getIterator(): ArrayIterator<int, Candidate>

Returns

ArrayIterator<int, Candidate>
Calls 1
public function forCaller(string $caller): self

Filters derivations by a caller without choosing between remaining values.

Parameters

$callerstring

Returns

self
Calls 3

Private surface 1§

Implementation details, listed for orientation only.

private list<Candidate> $candidates

Test cases 11§

Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.

Dedicated tests 1
Other tests reaching this symbol 10

Relations§

Instantiated in 1
Type declarations 6