classCallResults
final class CallResults
Restricted visibility: declared "@visibility root". Code outside that scope must not name this declaration.
What following a call produced, remembered for the next caller that leads there.
Following the same function with the same arguments reaches the same statements and returns the same value, however many callers lead there. Reading it once is what keeps a file whose functions call each other heavily from being walked over and over.
Constants§
public const MAX_REMEMBERED = 4096How many readings are remembered before the memory stops growing.
Methods§
public function keyFor(string $name, list<Domain> $arguments): stringpublic function recall(string $key): ?DomainWhat a reading produced last time, or null when it has not been read.
Parameters
$key | string |
Returns
Test cases 4
public function remember(string $key, Domain $result): voidRemembers what a reading produced, until the memory is full.
Parameters
$key | string | |
$result | Domain |
Test cases 3
Called from 1
Calls 2
- function-call
countline 57 - class-const CallResults::MAX_REMEMBERED() line 57
public function count(): intHow many readings are remembered.
Returns
intTest cases 9
CalleeReturnsTest::testReadDoesNotRememberWhatAnExhaustedBudgetCutShortcallsCalleeReturnsTest::testReadUnitesWhatEveryReturnCanReturncallsCalleeReturnsTest::testValueOfAnswersACallWithTheSameArgumentsFromMemorycallsCalleeReturnsTest::testValueOfLeavesAnAbstractMethodAsACallItDidNotFollowcallsCalleeReturnsTest::testValueOfReadsWhatTheCalleeReturnscallsCalleeReturnsTest::testValueOfStopsAtACallAlreadyBeingFollowedcallsCalleeReturnsTest::testValueOfStopsOnceTheBudgetIsExhaustedcallsCallResultsTest::testCountIsZeroBeforeAnythingIsRememberedcallsCallResultsTest::testRememberStopsOnceTheMemoryIsFullcalls
Calls 1
- function-call
countline 67
Private surface 1§
Implementation details, listed for orientation only.
private array<string, Domain> $results = []Test cases 15§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 4
Other tests reaching this symbol 11
CallEvaluatorTestcallsCalleeReturnsTest::testReadDoesNotRememberWhatAnExhaustedBudgetCutShortcallsCalleeReturnsTest::testReadUnitesWhatEveryReturnCanReturncallsCalleeReturnsTest::testValueOfAnswersACallWithTheSameArgumentsFromMemorycallsCalleeReturnsTest::testValueOfLeavesAnAbstractMethodAsACallItDidNotFollowcallsCalleeReturnsTest::testValueOfReadsWhatTheCalleeReturnscallsCalleeReturnsTest::testValueOfStopsAtACallAlreadyBeingFollowedcallsCalleeReturnsTest::testValueOfStopsOnceTheBudgetIsExhaustedcallsInterpreterTestcallsCallModelTestcallsAnalyzerTestcalls
Relations§
Instantiated in 1
Method calls 3
- method-call SqlCatalog\Core\Analysis\Derivation\CalleeReturns::valueOf() packages/sql-catalog/src/Core/Analysis/Derivation/CalleeReturns.php:79
- method-call SqlCatalog\Core\Analysis\Derivation\CalleeReturns::valueOf() packages/sql-catalog/src/Core/Analysis/Derivation/CalleeReturns.php:81
- method-call SqlCatalog\Core\Analysis\Derivation\CalleeReturns::read() packages/sql-catalog/src/Core/Analysis/Derivation/CalleeReturns.php:106