Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f70f6ce
chore: upgrade to symfony 8
aaa2000 Jan 21, 2026
0122d60
ci: fix tests after upgrade
aaa2000 Feb 1, 2026
342eaa3
ci: pin symfony/serializer to 8.0.4 for fixing tests
aaa2000 Feb 3, 2026
b08ae51
ci: fix after update
aaa2000 Feb 3, 2026
6ed0712
chore: composer update
aaa2000 Feb 4, 2026
9c5606d
ci: try fix ci
aaa2000 Feb 6, 2026
c4a7d6e
ci: phpcsfixer - ignore reference.php
aaa2000 Feb 6, 2026
0e085d0
ci: fix phpcsfixer
aaa2000 Feb 6, 2026
4e434df
update symfony/http-kernel
aaa2000 Feb 6, 2026
cb815d3
Update dama/doctrine-test-bundle recipe
aaa2000 Feb 8, 2026
0eb3250
chore: update zendstruck/foundry recipe
aaa2000 Feb 8, 2026
3c80d02
chore: update symfony/web-profiler-bundle recipe
aaa2000 Feb 8, 2026
baadba2
chore: update symfony/security-bundle recipe
aaa2000 Feb 8, 2026
9daf4f5
chore: update symfony/routing recipe
aaa2000 Feb 8, 2026
a3ecced
chore: update symfony/monolog-bundle recipe
aaa2000 Feb 8, 2026
a037cb9
chore: update symfony/framework-bundle recipe
aaa2000 Feb 8, 2026
76637d6
chore: update phpunit/phpunit recipe
aaa2000 Feb 8, 2026
dec854c
chore: update doctrine/doctrine-bundle recipe
aaa2000 Feb 8, 2026
ca65035
chore: fix incorecct phpdoc
aaa2000 Feb 8, 2026
0a29ce3
chore: simplify fqdn
aaa2000 Feb 8, 2026
359d522
ci: remove unnecessary file
aaa2000 Feb 13, 2026
f223642
chore: run rector
aaa2000 Feb 13, 2026
930f5a0
chore: fix php-cs-fixer
aaa2000 Feb 13, 2026
ccc3c3c
ci: fix unit test
aaa2000 Feb 13, 2026
fabf095
chore: run rector
aaa2000 Feb 13, 2026
de617e3
chore: run php-cs-fixer
aaa2000 Feb 13, 2026
1e10d76
chore: fix error when running rector
aaa2000 Feb 13, 2026
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
17 changes: 17 additions & 0 deletions api/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{compose.yaml,compose.*.yaml}]
indent_size = 2

[*.md]
trim_trailing_whitespace = false
9 changes: 8 additions & 1 deletion api/.env
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ OIDC_AUD=api-platform
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=!ChangeMe!
APP_SHARE_DIR=var/share
###< symfony/framework-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data_%kernel.environment%.db"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=8.0.32&charset=utf8mb4"
# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4"
DATABASE_URL="postgresql://app:!ChangeMe!@database:5432/app?serverVersion=16&charset=utf8"
Expand All @@ -52,3 +53,9 @@ MERCURE_PUBLIC_URL=https://localhost/.well-known/mercure
# The secret used to sign the JWTs
MERCURE_JWT_SECRET="!ChangeThisMercureHubJWTSecretKey!"
###< symfony/mercure-bundle ###

###> symfony/routing ###
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
DEFAULT_URI=http://localhost
###< symfony/routing ###
1 change: 0 additions & 1 deletion api/.env.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# define your env variables for the test env here
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
SYMFONY_DEPRECATIONS_HELPER=999999
OIDC_JWK='{"kty": "EC","d": "cT3_vKHaGOAhhmzR0Jbi1ko40dNtpjtaiWzm_7VNwLA","use": "sig","crv": "P-256","x": "n6PnJPqNK5nP-ymwwsOIqZvjiCKFNzRyqWA8KNyBsDo","y": "bQSmMlDXOmtgyS1rhsKUmqlxq-8Kw0Iw9t50cSloTMM","alg": "ES256"}'

# API Platform distribution
Expand Down
3 changes: 3 additions & 0 deletions api/.php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
$finder = new PhpCsFixer\Finder()
->in(__DIR__)
->exclude('var')
->notPath([
'config/reference.php',
])
;

return new PhpCsFixer\Config()
Expand Down
4 changes: 4 additions & 0 deletions api/bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env php
<?php

require dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit';
95 changes: 48 additions & 47 deletions api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,56 @@
"api-platform/graphql": "^4.2.16",
"api-platform/symfony": "^4.2.16",
"doctrine/common": "^3.5",
"doctrine/doctrine-bundle": "^2.15",
"doctrine/doctrine-fixtures-bundle": "^4.1",
"doctrine/doctrine-migrations-bundle": "^3.4.2",
"doctrine/orm": "^3.5.0",
"doctrine/persistence": "^3.4",
"doctrine/doctrine-bundle": "^3.2.2",
"doctrine/doctrine-fixtures-bundle": "^4.3.1",
"doctrine/doctrine-migrations-bundle": "^3.7.0",
"doctrine/orm": "^3.6.2",
"doctrine/persistence": "^4.1.1",
"myclabs/php-enum": "^1.8.5",
"nelmio/cors-bundle": "^2.5",
"runtime/frankenphp-symfony": "^0.2.0",
"nelmio/cors-bundle": "^2.6.1",
"seld/jsonlint": "^1.11",
"symfony/asset": "7.3.*",
"symfony/clock": "7.3.*",
"symfony/console": "7.3.*",
"symfony/dotenv": "7.3.*",
"symfony/expression-language": "7.3.*",
"symfony/flex": "^2.8.1",
"symfony/framework-bundle": "7.3.*",
"symfony/http-client": "7.3.*",
"symfony/mercure-bundle": "^0.3.9",
"symfony/monolog-bundle": "^3.10",
"symfony/property-access": "7.3.*",
"symfony/property-info": "7.3.*",
"symfony/runtime": "7.3.*",
"symfony/security-bundle": "7.3.*",
"symfony/serializer": "7.3.*",
"symfony/twig-bundle": "7.3.*",
"symfony/uid": "7.3.*",
"symfony/validator": "7.3.*",
"symfony/yaml": "7.3.*",
"web-token/jwt-bundle": "^4.0.4",
"webonyx/graphql-php": "^15.21.3",
"zenstruck/foundry": "^2.6.0"
"symfony/asset": "8.0.*",
"symfony/clock": "8.0.*",
"symfony/console": "8.0.*",
"symfony/dotenv": "8.0.*",
"symfony/expression-language": "8.0.*",
"symfony/flex": "^2.10.0",
"symfony/framework-bundle": "8.0.*",
"symfony/http-client": "8.0.*",
"symfony/http-kernel": "8.0.*",
"symfony/json-streamer": "^8.0.4",
"symfony/mercure-bundle": "^0.4.2",
"symfony/monolog-bundle": "^4.0.1",
"symfony/property-access": "8.0.*",
"symfony/runtime": "8.0.*",
"symfony/security-bundle": "8.0.*",
"symfony/serializer": "8.0.4",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symfony/serializer v8.0.5 breaks the phpunit tests @see symfony/serializer@35b1aec

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are the test results


Runtime:       PHP 8.4.14
Configuration: /app/phpunit.xml.dist

NNNNNNNNNNNNNNNNNNNNNNNNNNN.................FF.....FF..........  63 / 123 ( 51%)
............................................................    123 / 123 (100%)

Faker seed: 952770

Time: 00:40.389, Memory: 125.00 MB

There were 4 failures:

1) App\Tests\Api\Admin\BookTest::asAdminUserICannotCreateABookWithInvalidData@empty data with data (['', ''], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
    '@type' => 'ConstraintViolation',
    'hydra:title' => 'An error occurred',
    'hydra:description' => 'condition: This value should be of type int|string.',
    'violations' => Array &1 [
        0 => Array &2 [
            'propertyPath' => 'condition',
            'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
        ],
    ],
].
--- Expected
+++ Actual
@@ @@
       'propertyPath' => 'condition',
       'message' => 'This value should be of type .',
       'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
-      'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+      'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
     ),
   ),
   'detail' => 'condition: This value should be of type .',
   'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
-  'hydra:description' => 'condition: This value should be of type int|string.',
+  'hydra:description' => 'condition: This value should be of type .',
   'hydra:title' => 'An error occurred',
 )

/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:282

2) App\Tests\Api\Admin\BookTest::asAdminUserICannotCreateABookWithInvalidData@invalid condition with data (['https://gutendex.com/books/31547.json', 'invalid condition'], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
    '@type' => 'ConstraintViolation',
    'hydra:title' => 'An error occurred',
    'hydra:description' => 'condition: This value should be of type int|string.',
    'violations' => Array &1 [
        0 => Array &2 [
            'propertyPath' => 'condition',
            'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
        ],
    ],
].
--- Expected
+++ Actual
@@ @@
       'propertyPath' => 'condition',
       'message' => 'This value should be of type .',
       'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
-      'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+      'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
     ),
   ),
   'detail' => 'condition: This value should be of type .',
   'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
-  'hydra:description' => 'condition: This value should be of type int|string.',
+  'hydra:description' => 'condition: This value should be of type .',
   'hydra:title' => 'An error occurred',
 )

/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:282

3) App\Tests\Api\Admin\BookTest::asAdminUserICannotUpdateABookWithInvalidData@empty data with data (['', ''], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
    '@type' => 'ConstraintViolation',
    'hydra:title' => 'An error occurred',
    'hydra:description' => 'condition: This value should be of type int|string.',
    'violations' => Array &1 [
        0 => Array &2 [
            'propertyPath' => 'condition',
            'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
        ],
    ],
].
--- Expected
+++ Actual
@@ @@
       'propertyPath' => 'condition',
       'message' => 'This value should be of type .',
       'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
-      'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+      'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
     ),
   ),
   'detail' => 'condition: This value should be of type .',
   'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
-  'hydra:description' => 'condition: This value should be of type int|string.',
+  'hydra:description' => 'condition: This value should be of type .',
   'hydra:title' => 'An error occurred',
 )

/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:493

4) App\Tests\Api\Admin\BookTest::asAdminUserICannotUpdateABookWithInvalidData@invalid condition with data (['https://gutendex.com/books/31547.json', 'invalid condition'], 422, ['ConstraintViolation', 'An error occurred', 'condition: This value should ...tring.', [['condition', 'The data must belong to a bac...dition']]], ...2 more elements)
Failed asserting that an array has the subset Array &0 [
    '@type' => 'ConstraintViolation',
    'hydra:title' => 'An error occurred',
    'hydra:description' => 'condition: This value should be of type int|string.',
    'violations' => Array &1 [
        0 => Array &2 [
            'propertyPath' => 'condition',
            'hint' => 'The data must belong to a backed enumeration of type App\Enum\BookCondition',
        ],
    ],
].
--- Expected
+++ Actual
@@ @@
       'propertyPath' => 'condition',
       'message' => 'This value should be of type .',
       'code' => 'ba785a8c-82cb-4283-967c-3cf342181b40',
-      'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+      'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',
     ),
   ),
   'detail' => 'condition: This value should be of type .',
   'type' => '/validation_errors/ba785a8c-82cb-4283-967c-3cf342181b40',
-  'hydra:description' => 'condition: This value should be of type int|string.',
+  'hydra:description' => 'condition: This value should be of type .',
   'hydra:title' => 'An error occurred',
 )

/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubsetTrait.php:63
/app/vendor/api-platform/symfony/Bundle/Test/Constraint/ArraySubset.php:32
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:106
/app/vendor/api-platform/symfony/Bundle/Test/ApiTestAssertionsTrait.php:65
/app/tests/Api/Admin/BookTest.php:493

FAILURES!
Tests: 123, Assertions: 546, Failures: 4, PHPUnit Notices: 27.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with these changes:

-      'hint' => 'The data must belong to a backed enumeration of type App\\Enum\\BookCondition',
+      'hint' => 'The data must be one of the following values: \'https://schema.org/NewCondition\', \'https://schema.org/RefurbishedCondition\', \'https://schema.org/DamagedCondition\', \'https://schema.org/UsedCondition\'',

The problem is about those changes, which are incomplete:

-  'hydra:description' => 'condition: This value should be of type int|string.',
+  'hydra:description' => 'condition: This value should be of type .',

So indeed you can set symfony/serializer: <8.0.5, and then you (or I, if you don't have time) can investigate for a fix on Symfony/API Platform (depends where the problem is).

"symfony/twig-bundle": "8.0.*",
"symfony/uid": "8.0.*",
"symfony/validator": "8.0.*",
"symfony/yaml": "8.0.*",
"web-token/jwt-bundle": "^4.1.3",
"webonyx/graphql-php": "^15.30.2",
"zenstruck/foundry": "^2.9.1"
},
"require-dev": {
"dama/doctrine-test-bundle": "^8.3",
"justinrainbow/json-schema": "^6.4.2",
"dama/doctrine-test-bundle": "^8.6",
"justinrainbow/json-schema": "^6.7.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpdoc-parser": "^2.2",
"phpstan/phpstan": "^2.1.19",
"phpstan/phpstan-doctrine": "^2.0.4",
"phpstan/phpstan-phpunit": "^2.0.7",
"phpstan/phpstan-symfony": "^2.0.7",
"phpunit/phpunit": "^12.2.7",
"rector/rector": "^2.1.2",
"symfony/browser-kit": "7.3.*",
"symfony/css-selector": "7.3.*",
"symfony/debug-bundle": "7.3.*",
"symfony/maker-bundle": "^1.64.0",
"symfony/stopwatch": "7.3.*",
"symfony/var-dumper": "7.3.*",
"symfony/web-profiler-bundle": "7.3.*"
"phpstan/phpdoc-parser": "^2.3.2",
"phpstan/phpstan": "^2.1.39",
"phpstan/phpstan-doctrine": "^2.0.16",
"phpstan/phpstan-phpunit": "^2.0.15",
"phpstan/phpstan-symfony": "^2.0.14",
"phpunit/phpunit": "^12.5.11",
"rector/rector": "^2.3.6",
"symfony/browser-kit": "8.0.*",
"symfony/css-selector": "8.0.*",
"symfony/debug-bundle": "8.0.*",
"symfony/maker-bundle": "^1.66.0",
"symfony/stopwatch": "8.0.*",
"symfony/var-dumper": "8.0.*",
"symfony/web-profiler-bundle": "8.0.*"
},
"config": {
"optimize-autoloader": true,
Expand All @@ -76,7 +76,8 @@
"autoload": {
"psr-4": {
"App\\": "src/"
}
},
"classmap": ["config/"]
},
"autoload-dev": {
"psr-4": {
Expand Down Expand Up @@ -113,7 +114,7 @@
"extra": {
"symfony": {
"allow-contrib": false,
"require": "7.3.*",
"require": "8.0.*",
"docker": false,
"endpoint": [
"https://api.github.com/repos/Spomky-Labs/recipes/contents/index.json?ref=main",
Expand Down
Loading
Loading