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
49 changes: 28 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
env:
APP_DEBUG: '1' # https://github.com/phpstan/phpstan-symfony/issues/37
Expand Down Expand Up @@ -188,10 +188,12 @@ jobs:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
include:
- php: '8.2'
- php: '8.3'
- php: '8.4'
- php: '8.5'
coverage: true
fail-fast: false
steps:
Expand Down Expand Up @@ -262,10 +264,11 @@ jobs:
- version: '8.2'
- version: '8.3'
- version: '8.4'
- version: '8.5'
coverage: true
- version: '8.4'
- version: '8.5'
lowest: true
- version: '8.4'
- version: '8.5'
minimal-changes: true
component:
- api-platform/doctrine-common
Expand Down Expand Up @@ -351,7 +354,7 @@ jobs:
strategy:
matrix:
php:
- version: '8.4'
- version: '8.5'
component:
- api-platform/doctrine-common
- api-platform/doctrine-orm
Expand Down Expand Up @@ -404,10 +407,12 @@ jobs:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
include:
- php: '8.2'
- php: '8.3'
- php: '8.4'
- php: '8.5'
coverage: true
fail-fast: false
steps:
Expand Down Expand Up @@ -485,7 +490,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
env:
APP_ENV: postgres
Expand Down Expand Up @@ -539,7 +544,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
services:
mysql:
Expand Down Expand Up @@ -593,7 +598,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
env:
APP_ENV: mongodb
Expand Down Expand Up @@ -681,7 +686,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
env:
APP_ENV: mercure
Expand Down Expand Up @@ -839,7 +844,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -878,7 +883,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -921,7 +926,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -966,7 +971,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
env:
APP_ENV: sqlite
Expand Down Expand Up @@ -1063,7 +1068,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -1109,9 +1114,9 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
include:
- php: '8.4'
- php: '8.5'
coverage: true
fail-fast: false
steps:
Expand Down Expand Up @@ -1187,7 +1192,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -1235,7 +1240,7 @@ jobs:
strategy:
matrix:
php:
- '8.4'
- '8.5'
fail-fast: false
steps:
- name: Checkout
Expand Down Expand Up @@ -1286,10 +1291,12 @@ jobs:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
include:
- php: '8.2'
- php: '8.3'
- php: '8.4'
- php: '8.5'
coverage: true
fail-fast: false
steps:
Expand Down Expand Up @@ -1319,7 +1326,7 @@ jobs:
working-directory: 'src/Laravel'

laravel-e2e:
name: Laravel E2E installation (PHP 8.4)
name: Laravel E2E installation (PHP 8.5)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand All @@ -1328,7 +1335,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.4
php-version: 8.5
tools: pecl, composer
extensions: intl, bcmath, curl, openssl, mbstring, pdo_sqlite
ini-values: memory_limit=-1
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/Filter/ExistsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function __construct(?ManagerRegistry $managerRegistry = null, ?LoggerInt
public function apply(Builder $aggregationBuilder, string $resourceClass, ?Operation $operation = null, array &$context = []): void
{
$parameter = $context['parameter'] ?? null;
if (null !== ($value = $context['filters'][$parameter?->getProperty()] ?? null)) {
if (null !== ($value = $context['filters'][$parameter?->getProperty() ?? ''] ?? null)) {
$this->filterProperty($this->denormalizePropertyName($parameter->getProperty()), $value, $aggregationBuilder, $resourceClass, $operation, $context);

return;
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Odm/Filter/OrderFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public function apply(Builder $aggregationBuilder, string $resourceClass, ?Opera
}

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

return;
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/Orm/Filter/OrderFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public function apply(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $q
}

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

return;
Expand Down
2 changes: 0 additions & 2 deletions src/Doctrine/Orm/Tests/Extension/PaginationExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,6 @@ public function testGetResultWithFetchJoinCollection(bool $paginationFetchJoinCo
$this->assertInstanceOf(PaginatorInterface::class, $result);

$doctrinePaginatorReflectionProperty = new \ReflectionProperty(AbstractPaginator::class, 'paginator');
$doctrinePaginatorReflectionProperty->setAccessible(true);

$doctrinePaginator = $doctrinePaginatorReflectionProperty->getValue($result);
$this->assertSame($expected, $doctrinePaginator->getFetchJoinCollection());
Expand Down Expand Up @@ -436,7 +435,6 @@ public function testGetResultWithUseOutputWalkers(bool $paginationUseOutputWalke
$this->assertInstanceOf(PaginatorInterface::class, $result);

$doctrinePaginatorReflectionProperty = new \ReflectionProperty(AbstractPaginator::class, 'paginator');
$doctrinePaginatorReflectionProperty->setAccessible(true);

$doctrinePaginator = $doctrinePaginatorReflectionProperty->getValue($result);
$this->assertSame($expected, $doctrinePaginator->getUseOutputWalkers());
Expand Down
1 change: 0 additions & 1 deletion src/Hal/Tests/Serializer/ItemNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ public function testMaxDepth(): void
{
$setId = static function (MaxDepthDummy $dummy, int $id): void {
$prop = new \ReflectionProperty($dummy, 'id');
$prop->setAccessible(true);
$prop->setValue($dummy, $id);
};

Expand Down
1 change: 0 additions & 1 deletion src/Metadata/Extractor/PhpFileResourceExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ protected function extractPath(string $path): void
$resourceReflection = new \ReflectionClass($resource);

foreach ($resourceReflection->getProperties() as $property) {
$property->setAccessible(true);
$resolvedValue = $this->resolve($property->getValue($resource));
$property->setValue($resource, $resolvedValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,25 +129,25 @@ public function postFlush(): void
try {
$creatingObjects = clone $this->createdObjects;
foreach ($creatingObjects as $object) {
if ($this->createdObjects->contains($object)) {
$this->createdObjects->detach($object);
if ($this->createdObjects->offsetExists($object)) {
$this->createdObjects->offsetUnset($object);
}
$this->publishUpdate($object, $creatingObjects[$object], 'create');
}

$updatingObjects = clone $this->updatedObjects;
foreach ($updatingObjects as $object) {
if ($this->updatedObjects->contains($object)) {
$this->updatedObjects->detach($object);
if ($this->updatedObjects->offsetExists($object)) {
$this->updatedObjects->offsetUnset($object);
}
$this->publishUpdate($object, $updatingObjects[$object], 'update');
}

$deletingObjects = clone $this->deletedObjects;
foreach ($deletingObjects as $object) {
$options = $this->deletedObjects[$object];
if ($this->deletedObjects->contains($object)) {
$this->deletedObjects->detach($object);
if ($this->deletedObjects->offsetExists($object)) {
$this->deletedObjects->offsetUnset($object);
}
$this->publishUpdate($object, $deletingObjects[$object], 'delete');
}
Expand Down
7 changes: 5 additions & 2 deletions tests/Fixtures/TestBundle/Document/ResourceWithFloat.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ public function getId(): ?int
return $this->id;
}

public function getMyFloatField(): float
public function getMyFloatField(): string|float
{
return $this->myFloatField;
// php 8.5 emits warning unexpected NAN value was coerced to string
// with symfony serializer
// @see https://github.com/symfony/symfony/pull/62740
return is_nan($this->myFloatField) ? 'NAN' : $this->myFloatField;
}

public function setMyFloatField(float $myFloatField): void
Expand Down
14 changes: 10 additions & 4 deletions tests/Fixtures/TestBundle/Entity/ResourceWithFloat.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,26 @@ class ResourceWithFloat
#[ORM\GeneratedValue(strategy: 'AUTO')]
private ?int $id = null;
#[ORM\Column(type: 'float')]
private float $myFloatField = 0.0;
private string|float $myFloatField = 0.0;

public function getId(): ?int
{
return $this->id;
}

public function getMyFloatField(): float
public function getMyFloatField(): string|float
{
return $this->myFloatField;
// php 8.5 emits warning unexpected NAN value was coerced to string
// with symfony serializer
// @see https://github.com/symfony/symfony/pull/62740
return is_nan($this->myFloatField) ? 'NAN' : $this->myFloatField;
}

public function setMyFloatField(float $myFloatField): void
{
$this->myFloatField = $myFloatField;
// When binding a NAN value to a prepared statement parameter with Doctrine,
// PHP 8.5 emits a warning: "unexpected NAN value was coerced to string".
// @see https://github.com/doctrine/dbal/pull/7249
$this->myFloatField = is_nan($myFloatField) ? 'NAN' : $myFloatField;
}
}
Loading