classCandidateCollection
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.
(new \Deriver\Deriver\Candidate\CandidateCollection([], new \Deriver\Deriver\Candidate\ResultRef('r')))->count() // => 0Properties§
public ResultRef $referencepublic Statistics $statistics = new \Deriver\Deriver\Candidate\Statistics()public bool $interrupted = falseMethods§
public function __construct(
private list<Candidate> $candidates,
public ResultRef $reference,
public Statistics $statistics = new \Deriver\Deriver\Candidate\Statistics(),
public bool $interrupted = false,
)Parameters
$candidates | list<Candidate> | |
$reference | ResultRef | |
$statistics | Statistics | |
$interrupted | bool |
Calls 1
- new Statistics line 31
public function offsetExists(mixed $offset): boolTests whether an integer offset identifies a candidate.
Parameters
$offset | mixed | Offset supplied through ArrayAccess |
Returns
boolCalls 1
- function-call
is_intline 42
public function offsetGet(mixed $offset): Candidatepublic function offsetSet(mixed $offset, mixed $value): voidParameters
$offset | mixed | |
$value | mixed |
Throws
RuntimeException Candidate collections cannot be changedCalls 1
- new
RuntimeExceptionline 63
public function offsetUnset(mixed $offset): voidParameters
$offset | mixed |
Throws
RuntimeException Candidate collections cannot be changedCalls 1
- new
RuntimeExceptionline 71
public function count(): intReturns the number of concrete and partial candidate records.
Returns
intCalls 1
- function-call
countline 79
public function getIterator(): ArrayIterator<int, Candidate>Private surface 1§
Implementation details, listed for orientation only.
private list<Candidate> $candidatesTest 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
PhpContextcallsResultSetTest::testPreservesItsSemanticContractcallsJsonReporterTest::testReportFailsWithoutSilentlyReplacingBinaryStringscallsJsonReporterTest::testReportIncludesConcreteValuesAndOrderedEvidencecallsJsonReporterTest::testReportIncludesResidualStructurecallsJsonReporterTest::testReportProducesAnEmptyArrayForNoCandidatescallsReporterTest::testReportAcceptsACollectionWithoutAnAnalysisSessioncallsTextReporterTest::testReportDescribesAnEmptyCollectioncallsTextReporterTest::testReportDistinguishesPartialsAndInterruptioncallsTextReporterTest::testReportKeepsNativeLiteralTypesVisiblecalls
Relations§
Instantiated in 1
Type declarations 6
- type Deriver\Deriver packages/deriver/src/Deriver.php:91
- type Deriver\Deriver\Publication\CandidateCollector packages/deriver/src/Deriver/Publication/CandidateCollector.php:33
- type Deriver\Deriver\Publication\CandidateQuery packages/deriver/src/Deriver/Publication/CandidateQuery.php:36
- type Deriver\Reporter\JsonReporter packages/deriver/src/Reporter/JsonReporter.php:28
- type Deriver\Reporter\Reporter packages/deriver/src/Reporter/Reporter.php:20
- type Deriver\Reporter\TextReporter packages/deriver/src/Reporter/TextReporter.php:24