Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 35 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
ini-values: memory_limit=-1
tools: pecl, composer
coverage: none
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
ini-values: memory_limit=-1
tools: composer
coverage: none
Expand Down Expand Up @@ -149,6 +149,7 @@ jobs:
composer global require soyuka/pmu
composer global config allow-plugins.soyuka/pmu true --no-interaction
composer global link .
composer require --dev doctrine/mongodb-odm-bundle
- name: Cache PHPStan results
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -200,7 +201,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
coverage: pcov
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand All @@ -217,6 +218,9 @@ jobs:
composer global require soyuka/pmu
composer global config allow-plugins.soyuka/pmu true --no-interaction
composer global link .
- name: Force PHPUnit 11.5 for PHP 8.2
if: matrix.php == '8.2'
run: composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies
- name: Clear test app cache
run: tests/Fixtures/app/console cache:clear --ansi
- name: Run PHPUnit tests
Expand Down Expand Up @@ -288,12 +292,17 @@ jobs:
with:
php-version: ${{ matrix.php.version }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
ini-values: memory_limit=-1
- name: PMU
run: |
composer global require soyuka/pmu
composer global config allow-plugins.soyuka/pmu true --no-interaction
- name: Force PHPUnit 11.5 for PHP 8.2
if: matrix.php.version == '8.2'
run: |
cd $(composer ${{matrix.component}} --cwd)
composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies
- name: Linking
if: ${{ !matrix.php.lowest && !matrix.php.minimal-changes }}
run: |
Expand Down Expand Up @@ -368,7 +377,7 @@ jobs:
with:
php-version: ${{ matrix.php.version }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
ini-values: memory_limit=-1
- name: Linking
run: |
Expand Down Expand Up @@ -408,7 +417,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
coverage: pcov
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand All @@ -425,6 +434,9 @@ jobs:
composer global require soyuka/pmu
composer global config allow-plugins.soyuka/pmu true --no-interaction
composer global link .
- name: Force PHPUnit 11.5 for PHP 8.2
if: matrix.php == '8.2'
run: composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies
- name: Clear test app cache
run: tests/Fixtures/app/console cache:clear --ansi
- name: Run Behat tests (PHP ${{ matrix.php }})
Expand Down Expand Up @@ -492,7 +504,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_pgsql, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_pgsql
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -543,7 +555,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_mysql, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_mysql
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -825,7 +837,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -878,7 +890,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -918,7 +930,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -957,7 +969,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -1000,7 +1012,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
- name: Install additional packages
Expand Down Expand Up @@ -1048,7 +1060,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, fileinfo, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, fileinfo
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -1098,7 +1110,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
- name: Get composer cache directory
Expand Down Expand Up @@ -1142,7 +1154,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, mongodb
extensions: intl, bcmath, curl, openssl, mbstring
coverage: none
ini-values: memory_limit=-1
- name: Install additional packages
Expand Down Expand Up @@ -1314,7 +1326,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
ini-values: memory_limit=-1
- name: Setup node
uses: actions/setup-node@v4
Expand Down Expand Up @@ -1369,14 +1381,18 @@ jobs:
with:
php-version: ${{ matrix.php }}
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
ini-values: memory_limit=-1
- name: Update project dependencies
run: |
composer global require soyuka/pmu
composer global config allow-plugins.soyuka/pmu true --no-interaction
composer global link . --permanent
composer api-platform/laravel update
- name: Force PHPUnit 11.5 for PHP 8.2
if: matrix.php == '8.2'
working-directory: 'src/Laravel'
run: composer require phpunit/phpunit:^11.5 --dev --with-all-dependencies
- name: PHP version tweaks
run: |
composer run-script build
Expand All @@ -1395,7 +1411,7 @@ jobs:
with:
php-version: 8.4
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite, mongodb
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
ini-values: memory_limit=-1
- name: Update project dependencies
run: |
Expand Down
11 changes: 2 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,11 @@
"willdurand/negotiation": "^3.1"
},
"require-dev": {
"ext-mongodb": "^1.21 || ^2.0",
"behat/behat": "^3.11",
"behat/mink": "^1.9",
"doctrine/cache": "^1.11 || ^2.1",
"doctrine/common": "^3.2.2",
"doctrine/dbal": "^4.0",
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
"doctrine/mongodb-odm": "^2.10",
"doctrine/mongodb-odm-bundle": "^5.0",
"doctrine/orm": "^2.17 || ^3.0",
"elasticsearch/elasticsearch": "^7.17 || ^8.4 || ^9.0",
"friends-of-behat/mink-browserkit-driver": "^1.3.1",
Expand All @@ -156,7 +152,7 @@
"phpstan/phpstan-doctrine": "^2.0",
"phpstan/phpstan-phpunit": "^2.0",
"phpstan/phpstan-symfony": "^2.0",
"phpunit/phpunit": "11.5.x-dev",
"phpunit/phpunit": "^12.2",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"ramsey/uuid": "^4.7",
"ramsey/uuid-doctrine": "^2.0",
Expand Down Expand Up @@ -216,8 +212,5 @@
"symfony/json-streamer": "To use the JSON Streamer component.",
"webonyx/graphql-php": "To support GraphQL."
},
"type": "library",
"repositories": [
{"type": "vcs", "url": "https://github.com/soyuka/phpunit"}
]
"type": "library"
}
10 changes: 2 additions & 8 deletions src/Doctrine/Common/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"doctrine/mongodb-odm": "^2.10",
"doctrine/orm": "^2.17 || ^3.0",
"phpspec/prophecy-phpunit": "^2.2",
"phpunit/phpunit": "11.5.x-dev",
"phpunit/phpunit": "^12.2",
"symfony/type-info": "^7.3 || ^8.0"
},
"conflict": {
Expand Down Expand Up @@ -76,11 +76,5 @@
},
"scripts": {
"test": "./vendor/bin/phpunit"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/soyuka/phpunit"
}
]
}
}
5 changes: 2 additions & 3 deletions src/Doctrine/Odm/Filter/DateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
use ApiPlatform\Metadata\QueryParameter;
use ApiPlatform\OpenApi\Model\Parameter as OpenApiParameter;
use Doctrine\ODM\MongoDB\Aggregation\Builder;
use Doctrine\ODM\MongoDB\Types\Type as MongoDbType;

/**
* The date filter allows to filter a collection by date intervals.
Expand Down Expand Up @@ -127,8 +126,8 @@ final class DateFilter extends AbstractFilter implements DateFilterInterface, Js
use DateFilterTrait;

public const DOCTRINE_DATE_TYPES = [
MongoDbType::DATE => true,
MongoDbType::DATE_IMMUTABLE => true,
'date' => true,
'date_immutable' => true,
];

/**
Expand Down
6 changes: 3 additions & 3 deletions src/Doctrine/Odm/PropertyHelperTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ protected function getClassMetadata(string $resourceClass): ClassMetadata
$managerRegistry = $this->getManagerRegistry();
$manager = $managerRegistry?->getManagerForClass($resourceClass);

if ($manager) {
return $manager->getClassMetadata($resourceClass);
if (!$manager) {
throw new InvalidArgumentException(\sprintf('Unable to get class metadata for resource "%s". No object manager found.', $resourceClass));
}

return new MongoDbOdmClassMetadata($resourceClass);
return $manager->getClassMetadata($resourceClass);
}

/**
Expand Down
10 changes: 2 additions & 8 deletions src/Doctrine/Odm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
"doctrine/mongodb-odm-bundle": "^5.0",
"phpspec/prophecy-phpunit": "^2.2",
"phpunit/phpunit": "11.5.x-dev",
"phpunit/phpunit": "^12.2",
"symfony/cache": "^6.4 || ^7.0 || ^8.0",
"symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0",
"symfony/property-access": "^6.4 || ^7.0 || ^8.0",
Expand Down Expand Up @@ -76,11 +76,5 @@
},
"scripts": {
"test": "./vendor/bin/phpunit"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/soyuka/phpunit"
}
]
}
}
3 changes: 2 additions & 1 deletion src/Doctrine/Orm/Filter/ExistsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ public function __construct(?ManagerRegistry $managerRegistry = null, ?LoggerInt
public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?Operation $operation = null, array $context = []): void
{
$parameter = $context['parameter'] ?? null;
$propertyKey = $parameter?->getProperty();

if (null !== ($value = $context['filters'][$parameter?->getProperty()] ?? null)) {
if (null !== $propertyKey && null !== ($value = $context['filters'][$propertyKey] ?? null)) {
$this->filterProperty($this->denormalizePropertyName($parameter->getProperty()), $value, $queryBuilder, $queryNameGenerator, $resourceClass, $operation, $context);

return;
Expand Down
10 changes: 2 additions & 8 deletions src/Doctrine/Orm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"require-dev": {
"doctrine/doctrine-bundle": "^2.11 || ^3.1",
"phpspec/prophecy-phpunit": "^2.2",
"phpunit/phpunit": "11.5.x-dev",
"phpunit/phpunit": "^12.2",
"ramsey/uuid": "^4.7",
"ramsey/uuid-doctrine": "^2.0",
"symfony/cache": "^6.4 || ^7.0 || ^8.0",
Expand Down Expand Up @@ -76,11 +76,5 @@
},
"scripts": {
"test": "./vendor/bin/phpunit"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/soyuka/phpunit"
}
]
}
}
10 changes: 2 additions & 8 deletions src/Documentation/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "11.5.x-dev"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/soyuka/phpunit"
}
]
"phpunit/phpunit": "^12.2"
}
}
Loading
Loading