Skip to content

Commit

Permalink
changed private funtions to protected and added comments where I chan…
Browse files Browse the repository at this point in the history
…ged the overrode class
  • Loading branch information
AzizKHAN030 committed Jun 10, 2022
1 parent 89cf4d6 commit b0aace9
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/Elasticsearch5/SearchAdapter/Aggregation/Interval.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,37 +27,37 @@ class Interval extends CoreInterval
/**
* @var ConnectionManager
*/
private $connectionManager;
protected $connectionManager;

/**
* @var FieldMapperInterface
*/
private $fieldMapper;
protected $fieldMapper;

/**
* @var Config
*/
private $clientConfig;
protected $clientConfig;

/**
* @var string
*/
private $fieldName;
protected $fieldName;

/**
* @var string
*/
private $storeId;
protected $storeId;

/**
* @var array
*/
private $entityIds;
protected $entityIds;

/**
* @var SearchIndexNameResolver
*/
private $searchIndexNameResolver;
protected $searchIndexNameResolver;

/**
* @param ConnectionManager $connectionManager
Expand Down Expand Up @@ -103,8 +103,8 @@ public function __construct(
public function load($limit, $offset = null, $lower = null, $upper = null)
{

$from = ['gte' => 0];
$to = ['lt' => 0];
$from = ['gte' => 0]; //Added this because in some situations the $lower is null and $from is not declared
$to = ['lt' => 0]; //Added this because in some situations the $data is null and $to is not declared

if ($lower) {
$from = ['gte' => $lower - self::DELTA];
Expand Down Expand Up @@ -137,8 +137,8 @@ public function load($limit, $offset = null, $lower = null, $upper = null)
public function loadPrevious($data, $index, $lower = null)
{

$from = ['gte' => 0];
$to = ['lt' => 0];
$from = ['gte' => 0]; //Added this because in some situations the $lower is null and $from is not declared
$to = ['lt' => 0]; //Added this because in some situations the $data is null and $to is not declared

if ($lower) {
$from = ['gte' => $lower - self::DELTA];
Expand Down Expand Up @@ -176,7 +176,7 @@ public function loadPrevious($data, $index, $lower = null)
*
* @return float[]
*/
private function arrayValuesToFloat(array $hits, string $fieldName): array
protected function arrayValuesToFloat(array $hits, string $fieldName): array
{
$returnPrices = [];
foreach ($hits as $hit) {
Expand All @@ -186,15 +186,14 @@ private function arrayValuesToFloat(array $hits, string $fieldName): array
return $returnPrices;
}


/**
* Prepare base query for search.
*
* @param array|null $from
* @param array|null $to
* @return array
*/
private function prepareBaseRequestQuery($from = null, $to = null): array
protected function prepareBaseRequestQuery($from = null, $to = null): array
{
$requestQuery = [
'index' => $this->searchIndexNameResolver->getIndexName($this->storeId, Fulltext::INDEXER_ID),
Expand Down Expand Up @@ -234,5 +233,4 @@ private function prepareBaseRequestQuery($from = null, $to = null): array

return $requestQuery;
}

}

0 comments on commit b0aace9

Please sign in to comment.