Skip to content

Commit

Permalink
collection: rename method to getArgumentsForExpansion
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Jul 11, 2022
1 parent fe13b6b commit 8371c08
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Collection/Functions/CompareEqualsFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function evaluateInDb(DbalExpressionResult $expression, $value, string
// Multi-column primary key handling
// extract column names for multiOr simplification
// array{%column, array<string>}
$args = $expression->getExpansionArguments();
$args = $expression->getArgumentsForExpansion();
if (count($args) === 2 && $args[0] === '%column' && is_array($args[1])) {
$modifiers = explode(',', $modifier);
$columns = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Functions/CompareNotEqualsFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function evaluateInDb(DbalExpressionResult $expression, $value, string
// Multi-column primary key handling
// extract column names for multiOr simplification
// array{%column, array<string>}
$args = $expression->getExpansionArguments();
$args = $expression->getArgumentsForExpansion();
if (count($args) === 2 && $args[0] === '%column' && is_array($args[1])) {
$modifiers = explode(',', $modifier);
$columns = [];
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Functions/JunctionFunctionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected function processQueryBuilderExpressionWithModifier(
foreach ($normalized as $collectionFunctionArgs) {
$expression = $helper->processFilterFunction($builder, $collectionFunctionArgs, $aggregator);
$expression = $expression->applyAggregator($builder);
$processedArgs[] = $expression->getExpansionArguments();
$processedArgs[] = $expression->getArgumentsForExpansion();
$joins = array_merge($joins, $expression->joins);
$groupBy = array_merge($groupBy, $expression->groupBy);
$isHavingClause = $isHavingClause || $expression->isHavingClause;
Expand Down
2 changes: 1 addition & 1 deletion src/Collection/Helpers/DbalExpressionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function append(string $expression, ...$args): DbalExpressionResult
* Suitable as an `%ex` modifier argument.
* @return array<mixed>
*/
public function getExpansionArguments(): array
public function getArgumentsForExpansion(): array
{
$args = $this->args;
array_unshift($args, $this->expression);
Expand Down
4 changes: 2 additions & 2 deletions src/Collection/Helpers/DbalQueryBuilderHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function processFilterFunction(
*/
public function processOrderDirection(DbalExpressionResult $expression, string $direction): array
{
$args = $expression->getExpansionArguments();
$args = $expression->getArgumentsForExpansion();
if ($this->platformName === 'mysql') {
if ($direction === ICollection::ASC || $direction === ICollection::ASC_NULLS_FIRST) {
return ['%ex ASC', $args];
Expand Down Expand Up @@ -223,7 +223,7 @@ public function mergeJoins(string $dbalModifier, array $joins): array
$hash = md5(Json::encode([$join->onExpression, $join->onArgs]));
/**
* We aggregate only by alias as we assume that having a different alias
* for different select-from expressions is a responsibility of query-helper/user.
* for different select-from expressions is a responsibility of the query-helper/user.
*/
$aggregated[$join->toAlias][$hash] = $join;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DbalValueOperatorFunctionTest extends TestCase

Assert::same(
$expected,
$function->processQueryBuilderExpression($helper, $builder, $expr)->getExpansionArguments()
$function->processQueryBuilderExpression($helper, $builder, $expr)->getArgumentsForExpansion()
);
}

Expand Down

0 comments on commit 8371c08

Please sign in to comment.