Skip to content

Commit 7e3f4c7

Browse files
committed
MC-33231: Stabilize Integration tests to work with elasticsearch
- Added static failure fixes
1 parent db69693 commit 7e3f4c7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/internal/Magento/Framework/Search/Dynamic/Algorithm.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ protected function _findValueSeparator($quantileNumber, IntervalInterface $inter
298298
$interval->load($intervalValuesCount + 1, $offset, $lowerValue, $this->_upperLimit)
299299
);
300300
}
301+
// phpcs:ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall
301302
$lastValue = $this->offsetLimits($intervalValuesCount, $values);
302303
$bestRoundValue = [];
303304

@@ -500,6 +501,7 @@ protected function _mergeRoundValues(&$oldRoundValues, &$newRoundValues)
500501
foreach ($newRoundValues as $roundingFactor => $roundValueValues) {
501502
if (array_key_exists($roundingFactor, $oldRoundValues)) {
502503
$oldRoundValues[$roundingFactor] = array_unique(
504+
// phpcs:ignore Magento2.Performance.ForeachArrayMerge
503505
array_merge($oldRoundValues[$roundingFactor], $roundValueValues)
504506
);
505507
} else {
@@ -554,6 +556,7 @@ protected function _findBestSeparator($quantileNumber, $separators)
554556

555557
/**
556558
* Search first index of value, that satisfy conditions to be 'greater or equal' than $value
559+
*
557560
* Returns -1 if index was not found
558561
*
559562
* @param float $value
@@ -596,6 +599,13 @@ protected function _binarySearch($value, $limits = null)
596599
return $this->_binarySearch($value, [$limits[0], $limits[1]]);
597600
}
598601

602+
/**
603+
* Get the offsetLimit value
604+
*
605+
* @param $intervalValuesCount
606+
* @param $values
607+
* @return mixed
608+
*/
599609
private function offsetLimits($intervalValuesCount, $values)
600610
{
601611
if (array_key_exists((int)$intervalValuesCount - 1, $values)) {

0 commit comments

Comments
 (0)