classEquivalence
final class Equivalence
Restricted visibility: declared "@visibility SqlSemantics". Code outside that scope must not name this declaration.
Compares two statement structures operand by operand.
Two structures correspond when they have the same classes, the same scalar values and enum cases, and lists of the same length and order, recursively. This is a comparison of actual operands, not of a fingerprint or of text.
Methods§
public function difference(object $left, object $right): ?stringAnswers the path of the first difference, or null when the structures correspond.
Parameters
$left | object | |
$right | object |
Returns
?stringTest cases 7
RoundTripTarget::verifycallsSchemaTarget::verifycallsEquivalenceTest::testDifferenceIsNullForTwoAnalysesOfTheSameRequestcallsEquivalenceTest::testDifferenceNamesAChangedClasscallsEquivalenceTest::testDifferenceNamesAChangedEnumCaseAndADroppedAliascallsEquivalenceTest::testDifferenceNamesAChangedScalarValuecallsEquivalenceTest::testDifferenceNamesAListOfAnotherLengthcalls
Called from 1
Calls 9
- function-call
array_popline 36 - function-call
is_arrayline 39 - function-call
array_keysline 40 - function-call
countline 41 - function-call
is_objectline 50 - method-call Equivalence::describe() line 52
- function-call
is_scalarline 52 - function-call
get_debug_typeline 52 - method-call Equivalence::members() line 59
public function members(object $value): list<ReflectionProperty>Answers the properties of a class, cached for one comparison.
Parameters
$value | object |
Returns
list<ReflectionProperty>Test cases 1
Called from 1
public function describe(UnitEnum|string|int|float|bool $value): stringDescribes a compared scalar or enum case in a failure message.
Parameters
$value | UnitEnum|string|int|float|bool |
Returns
stringTest cases 1
Called from 1
Calls 1
- function-call
var_exportline 84
Private surface 1§
Implementation details, listed for orientation only.
private array<class-string, list<ReflectionProperty>> $properties = []Test cases 9§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 7
EquivalenceTest::testDescribeSpellsScalarsAndEnumCasescallsEquivalenceTest::testDifferenceIsNullForTwoAnalysesOfTheSameRequestcallsEquivalenceTest::testDifferenceNamesAChangedClasscallsEquivalenceTest::testDifferenceNamesAChangedEnumCaseAndADroppedAliascallsEquivalenceTest::testDifferenceNamesAChangedScalarValuecallsEquivalenceTest::testDifferenceNamesAListOfAnotherLengthcallsEquivalenceTest::testMembersAnswersThePropertiesOfAClassOncecalls
Other tests reaching this symbol 2
RoundTripTarget::verifycallsSchemaTarget::verifycalls