schranz-php-recipes / symfony-recipes-php

Provides https://github.com/symfony/recipes as PHP instead of YAML configs.
MIT License
13 stars 3 forks source link

Update recipes 2024-09-27 #109

Closed symfony-php-recipes-bot closed 1 month ago

symfony-php-recipes-bot commented 1 month ago
Q A
License MIT

The Symfony Recipes changed with version . This PR contains the new definition for recipes.

github-actions[bot] commented 1 month ago

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/schranz-php-recipes/symfony-recipes-php/flex/pull-109/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/schranz-php-recipes/symfony-recipes-php/flex/pull-109/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'api-platform/core:^4.0' 'api-platform/symfony:^4.0'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. I'm going keep this comment up to date with any updates of the attached patch.

api-platform/core

2.1 vs 2.5 ```diff diff --git a/api-platform/core/2.1/config/packages/api_platform.php b/api-platform/core/2.5/config/packages/api_platform.php index 2765011..ebc7fc1 100644 --- a/api-platform/core/2.1/config/packages/api_platform.php +++ b/api-platform/core/2.5/config/packages/api_platform.php @@ -9,5 +9,11 @@ return static function (ContainerConfigurator $containerConfigurator): void { 'mapping' => [ 'paths' => ['%kernel.project_dir%/src/Entity'], ], + 'patch_formats' => [ + 'json' => ['application/merge-patch+json'], + ], + 'swagger' => [ + 'versions' => [3], + ], ]); }; ```
2.5 vs 3.0 ```diff diff --git a/api-platform/core/2.5/config/packages/api_platform.php b/api-platform/core/2.5/config/packages/api_platform.php deleted file mode 100644 index ebc7fc1..0000000 --- a/api-platform/core/2.5/config/packages/api_platform.php +++ /dev/null @@ -1,19 +0,0 @@ -extension('api_platform', [ - 'mapping' => [ - 'paths' => ['%kernel.project_dir%/src/Entity'], - ], - 'patch_formats' => [ - 'json' => ['application/merge-patch+json'], - ], - 'swagger' => [ - 'versions' => [3], - ], - ]); -}; diff --git a/api-platform/core/2.5/manifest.json b/api-platform/core/3.0/manifest.json index a886a48..af16452 100644 --- a/api-platform/core/2.5/manifest.json +++ b/api-platform/core/3.0/manifest.json @@ -1,6 +1,6 @@ { "bundles": { - "ApiPlatform\\Core\\Bridge\\Symfony\\Bundle\\ApiPlatformBundle": ["all"] + "ApiPlatform\\Symfony\\Bundle\\ApiPlatformBundle": ["all"] }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/", diff --git a/api-platform/core/2.5/src/Entity/.gitignore b/api-platform/core/3.0/src/ApiResource/.gitignore similarity index 100% rename from api-platform/core/2.5/src/Entity/.gitignore rename to api-platform/core/3.0/src/ApiResource/.gitignore ```
3.0 vs 3.1 ```diff diff --git a/api-platform/core/3.1/config/packages/api_platform.php b/api-platform/core/3.1/config/packages/api_platform.php new file mode 100644 index 0000000..bd1c571 --- /dev/null +++ b/api-platform/core/3.1/config/packages/api_platform.php @@ -0,0 +1,21 @@ +extension('api_platform', [ + 'title' => 'Hello API Platform', + 'version' => '1.0.0', + 'defaults' => [ + 'stateless' => true, + 'cache_headers' => [ + 'vary' => ['Content-Type', 'Authorization', 'Origin'], + ], + 'extra_properties' => [ + 'standard_put' => true, + ], + ], + ]); +}; ```
3.1 vs 3.2 ```diff diff --git a/api-platform/core/3.1/config/packages/api_platform.php b/api-platform/core/3.2/config/packages/api_platform.php index bd1c571..08a0a70 100644 --- a/api-platform/core/3.1/config/packages/api_platform.php +++ b/api-platform/core/3.2/config/packages/api_platform.php @@ -8,6 +8,14 @@ return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->extension('api_platform', [ 'title' => 'Hello API Platform', 'version' => '1.0.0', + 'formats' => [ + 'jsonld' => ['application/ld+json'], + ], + 'docs_formats' => [ + 'jsonld' => ['application/ld+json'], + 'jsonopenapi' => ['application/vnd.openapi+json'], + 'html' => ['text/html'], + ], 'defaults' => [ 'stateless' => true, 'cache_headers' => [ @@ -15,7 +23,10 @@ return static function (ContainerConfigurator $containerConfigurator): void { ], 'extra_properties' => [ 'standard_put' => true, + 'rfc_7807_compliant_errors' => true, ], ], + 'event_listeners_backward_compatibility_layer' => false, + 'keep_legacy_inflector' => false, ]); }; ```
3.2 vs 3.3 ```diff diff --git a/api-platform/core/3.2/config/packages/api_platform.php b/api-platform/core/3.3/config/packages/api_platform.php index 08a0a70..d425925 100644 --- a/api-platform/core/3.2/config/packages/api_platform.php +++ b/api-platform/core/3.3/config/packages/api_platform.php @@ -26,7 +26,7 @@ return static function (ContainerConfigurator $containerConfigurator): void { 'rfc_7807_compliant_errors' => true, ], ], - 'event_listeners_backward_compatibility_layer' => false, 'keep_legacy_inflector' => false, + 'use_symfony_listeners' => true, ]); }; ```
3.3 vs 4.0 ```diff diff --git a/api-platform/core/3.3/config/packages/api_platform.php b/api-platform/core/4.0/config/packages/api_platform.php index d425925..901a24d 100644 --- a/api-platform/core/3.3/config/packages/api_platform.php +++ b/api-platform/core/4.0/config/packages/api_platform.php @@ -8,25 +8,11 @@ return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->extension('api_platform', [ 'title' => 'Hello API Platform', 'version' => '1.0.0', - 'formats' => [ - 'jsonld' => ['application/ld+json'], - ], - 'docs_formats' => [ - 'jsonld' => ['application/ld+json'], - 'jsonopenapi' => ['application/vnd.openapi+json'], - 'html' => ['text/html'], - ], 'defaults' => [ 'stateless' => true, 'cache_headers' => [ 'vary' => ['Content-Type', 'Authorization', 'Origin'], ], - 'extra_properties' => [ - 'standard_put' => true, - 'rfc_7807_compliant_errors' => true, - ], ], - 'keep_legacy_inflector' => false, - 'use_symfony_listeners' => true, ]); }; ```

api-platform/symfony

3.3 vs 4.0 ```diff diff --git a/api-platform/symfony/3.3/config/packages/api_platform.php b/api-platform/symfony/4.0/config/packages/api_platform.php index d425925..901a24d 100644 --- a/api-platform/symfony/3.3/config/packages/api_platform.php +++ b/api-platform/symfony/4.0/config/packages/api_platform.php @@ -8,25 +8,11 @@ return static function (ContainerConfigurator $containerConfigurator): void { $containerConfigurator->extension('api_platform', [ 'title' => 'Hello API Platform', 'version' => '1.0.0', - 'formats' => [ - 'jsonld' => ['application/ld+json'], - ], - 'docs_formats' => [ - 'jsonld' => ['application/ld+json'], - 'jsonopenapi' => ['application/vnd.openapi+json'], - 'html' => ['text/html'], - ], 'defaults' => [ 'stateless' => true, 'cache_headers' => [ 'vary' => ['Content-Type', 'Authorization', 'Origin'], ], - 'extra_properties' => [ - 'standard_put' => true, - 'rfc_7807_compliant_errors' => true, - ], ], - 'keep_legacy_inflector' => false, - 'use_symfony_listeners' => true, ]); }; diff --git a/api-platform/symfony/3.3/post-install.txt b/api-platform/symfony/4.0/post-install.txt index 613c2b8..82bb10a 100644 --- a/api-platform/symfony/3.3/post-install.txt +++ b/api-platform/symfony/4.0/post-install.txt @@ -4,7 +4,7 @@ * Using MakerBundle? Try php bin/console make:entity --api-resource - * To enable the GraphQL support, run composer require webonyx/graphql-php, + * To enable the GraphQL support, run composer require api-platform/graphql, then browse /api/graphql. * Read the documentation at https://api-platform.com/docs/ ```