Skip to content

Commit

Permalink
Merge branch '2.6.x' into 2.5.x-merge-up-into-2.6.x_TYQBMVqZ
Browse files Browse the repository at this point in the history
* 2.6.x:
  Add $search stage to aggregation pipeline builder (doctrine#2516)
  Support new aggregation operators in builder (doctrine#2514)
  Drop support for PHP 7.4 (doctrine#2515)
  Support new aggregation pipeline stages in builder (doctrine#2513)
  • Loading branch information
alcaeus committed Apr 11, 2023
2 parents 10530b3 + 3091159 commit 4e338b0
Show file tree
Hide file tree
Showing 257 changed files with 12,029 additions and 6,942 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"
- "8.1"
- "8.2"
Expand All @@ -33,7 +32,7 @@ jobs:
- "highest"
include:
- dependencies: "lowest"
php-version: "7.4"
php-version: "8.0"
mongodb-version: "4.4"
driver-version: "1.11.0"
topology: "server"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
php-version:
- "7.4"
- "8.0"

services:
mongodb:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.1"
- "8.2"

steps:
- name: "Checkout code"
Expand Down Expand Up @@ -88,4 +88,4 @@ jobs:
path: composer.lock

- name: "Run a static analysis with vimeo/psalm"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc) --php-version=${{ matrix.php-version }}"
run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ vendor/
.phpunit.cache
.phpunit.result.cache
phpcs.xml
psalm.xml
6 changes: 6 additions & 0 deletions UPGRADE-2.6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# UPGRADE FROM to 2.6

## PHP requirements

* MongoDB ODM 2.6 requires PHP 8.0 or newer. If you're not running PHP 8.0 yet,
it's recommended that you upgrade to PHP 8.0 before upgrading ODM.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{ "name": "Fran Moreno", "email": "[email protected]" }
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.0",
"ext-mongodb": "^1.11",
"doctrine/annotations": "^1.12 || ^2.0",
"doctrine/cache": "^1.11 || ^2.0",
Expand Down
24 changes: 3 additions & 21 deletions lib/Doctrine/ODM/MongoDB/Aggregation/Aggregation.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,16 @@
use function array_merge;
use function assert;

/** @psalm-import-type PipelineExpression from Builder */
final class Aggregation implements IteratorAggregate
{
private DocumentManager $dm;

private ?ClassMetadata $classMetadata;

private Collection $collection;

/** @var array<string, mixed> */
private array $pipeline;

/** @var array<string, mixed> */
private array $options;

private bool $rewindable;

/**
* @param array<string, mixed> $pipeline
* @param array<string, mixed> $options
* @psalm-param PipelineExpression $pipeline
*/
public function __construct(DocumentManager $dm, ?ClassMetadata $classMetadata, Collection $collection, array $pipeline, array $options = [], bool $rewindable = true)
public function __construct(private DocumentManager $dm, private ?ClassMetadata $classMetadata, private Collection $collection, private array $pipeline, private array $options = [], private bool $rewindable = true)
{
$this->dm = $dm;
$this->classMetadata = $classMetadata;
$this->collection = $collection;
$this->pipeline = $pipeline;
$this->options = $options;
$this->rewindable = $rewindable;
}

public function getIterator(): Iterator
Expand Down
Loading

0 comments on commit 4e338b0

Please sign in to comment.