symfony / recipes

Symfony Recipes Repository
https://github.com/symfony/recipes/blob/flex/main/RECIPES.md
MIT License
953 stars 472 forks source link

[MakerBundle] final class & root namespace configuration #1315

Open jrushlow opened 1 month ago

jrushlow commented 1 month ago
Q A
License MIT
Doc issue/PR see below

_PR 1539 implements the generate_final_* functionality for make:crud & make:voter. To keep that PR relatively small and reviewable, PR's will be made for other makers for release v1.60.0_

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/symfony/recipes/flex/pull-1315/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1315/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/maker-bundle:^1.60'
  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.

symfony/maker-bundle

1.0 vs 1.60 ```diff diff --git a/symfony/maker-bundle/1.60/config/packages/maker.yaml b/symfony/maker-bundle/1.60/config/packages/maker.yaml new file mode 100644 index 0000000..7fd5b34 --- /dev/null +++ b/symfony/maker-bundle/1.60/config/packages/maker.yaml @@ -0,0 +1,12 @@ +when@dev: + maker: + # tell MakerBundle that all of your classes live in an + # Acme namespace, instead of the default App + # (e.g. Acme\Entity\Article, Acme\Command\MyCommand, etc) + root_namespace: 'App' + + # Tell MakerBundle to make all non-entity classes it generates, "final". + generate_final_classes: true + + # Tell MakerBundle to make all entities it generates, "final". + generate_final_entities: false diff --git a/symfony/maker-bundle/1.0/manifest.json b/symfony/maker-bundle/1.60/manifest.json index 7d42386..d8f4d89 100644 --- a/symfony/maker-bundle/1.0/manifest.json +++ b/symfony/maker-bundle/1.60/manifest.json @@ -2,5 +2,8 @@ "bundles": { "Symfony\\Bundle\\MakerBundle\\MakerBundle": ["dev"] }, - "aliases": ["maker", "generator", "make"] + "aliases": ["maker", "generator", "make"], + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/" + } } ```