Skip to content

Commit

Permalink
try again to fix static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
franmomu committed Mar 31, 2023
1 parent e019fcf commit 00c4324
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/ODM/MongoDB/Aggregation/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ public function getPipeline(/* bool $applyFilters = true */): array
));
}

assert(count($this->stages) > 0);

$pipeline = array_map(
static fn (Stage $stage) => $stage->getExpression(),
$this->stages,
);

assert(count($this->stages) > 0);

if ($this->getStage(0) instanceof Stage\IndexStats) {
// Don't apply any filters when using an IndexStats stage: since it
// needs to be the first pipeline stage, prepending a match stage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function returnStoredSource(bool $returnStoredSource): Search
return $this->search->returnStoredSource($returnStoredSource);
}

/** @return array<string, object> */
/** @return array<non-empty-string, object> */
final public function getExpression(): array
{
return [$this->getOperatorName() => $this->getOperatorParams()];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ interface SearchOperator
/**
* @internal
*
* @return array<string, object>
* @return array<non-empty-string, object>
*/
public function getExpression(): array;

/** @internal */
/**
* @internal
*
* @return non-empty-string
*/
public function getOperatorName(): string;

/** @internal */
Expand Down

0 comments on commit 00c4324

Please sign in to comment.