/**
  * Compares composites that contain only AND conditions (that are not composites).
  * 
  * @param ConditionComposite $comp1
  * @param ConditionComposite $comp2
  * 
  * @throws IncomparableConditions when it's not possible to compare leaves
  * @return boolean
  */
 protected function ANDCompositesAreEqual(ConditionComposite $comp1, ConditionComposite $comp2)
 {
     return ArrayComparator::arraysHoldEqualElements($comp1->getANDConditions(), $comp2->getANDConditions(), function (Condition $c1, Condition $c2) {
         return $this->leafEqualityComparator->equal($c1, $c2);
     });
 }
Ejemplo n.º 2
0
 protected function compositeExactlyMatchesStructure(ConditionComposite $c, array $desiredDecomposedStructure)
 {
     return ArrayComparator::arraysHoldEqualElements($this->decompose($c), $desiredDecomposedStructure, function (array $row1, array $row2) {
         return ArrayComparator::arraysHoldEqualElements($row1, $row2);
     });
 }
Ejemplo n.º 3
0
 protected function decomposedStructuresAreIdentical(array $arr1, array $arr2)
 {
     return ArrayComparator::arraysHoldEqualElements($arr1, $arr2, function ($arr1Row, $arr2Row) {
         return ArrayComparator::arraysHoldEqualElements($arr1Row, $arr2Row);
     });
 }