From 7e7747e2adc6b39c7fa388dd6d81918922ba69bb Mon Sep 17 00:00:00 2001 From: Nicolas PHILIPPE Date: Mon, 28 Jul 2025 15:55:20 +0200 Subject: [PATCH] [zenstruck/foundry] enable auto refresh with lazy objects in 2.7 (#1441) --- .../config/packages/zenstruck_foundry.yaml | 8 +++++ zenstruck/foundry/2.7/manifest.json | 33 +++++++++++++++++++ zenstruck/foundry/2.7/post-install.txt | 4 +++ zenstruck/foundry/2.7/src/Story/AppStory.php | 15 +++++++++ 4 files changed, 60 insertions(+) create mode 100644 zenstruck/foundry/2.7/config/packages/zenstruck_foundry.yaml create mode 100644 zenstruck/foundry/2.7/manifest.json create mode 100644 zenstruck/foundry/2.7/post-install.txt create mode 100644 zenstruck/foundry/2.7/src/Story/AppStory.php diff --git a/zenstruck/foundry/2.7/config/packages/zenstruck_foundry.yaml b/zenstruck/foundry/2.7/config/packages/zenstruck_foundry.yaml new file mode 100644 index 00000000..20592c51 --- /dev/null +++ b/zenstruck/foundry/2.7/config/packages/zenstruck_foundry.yaml @@ -0,0 +1,8 @@ +when@dev: &dev + # See full configuration: https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#full-default-bundle-configuration + zenstruck_foundry: + persistence: + # Flush only once per call of `PersistentObjectFactory::create()` + flush_once: true + +when@test: *dev diff --git a/zenstruck/foundry/2.7/manifest.json b/zenstruck/foundry/2.7/manifest.json new file mode 100644 index 00000000..d96ab7ef --- /dev/null +++ b/zenstruck/foundry/2.7/manifest.json @@ -0,0 +1,33 @@ +{ + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + "src/": "%SRC_DIR%/" + }, + "bundles": { + "Zenstruck\\Foundry\\ZenstruckFoundryBundle": ["dev", "test"] + }, + "conflict": { + "doctrine/persistence": "<2.0", + "symfony/flex": "<1.23.0 || >=2.0.0,<2.8.0", + "symfony/framework-bundle": "<6.4" + }, + "aliases": ["foundry"], + "add-lines": [ + { + "file": "phpunit.dist.xml", + "content": " ", + "position": "after_target", + "target": "", + "requires": "phpunit/phpunit:>=10", + "warn_if_missing": false + }, + { + "file": "config/packages/zenstruck_foundry.yaml", + "content": " enable_auto_refresh_with_lazy_objects: true", + "position": "after_target", + "target": "zenstruck_foundry:", + "requires": "php:>=8.4", + "warn_if_missing": false + } + ] +} diff --git a/zenstruck/foundry/2.7/post-install.txt b/zenstruck/foundry/2.7/post-install.txt new file mode 100644 index 00000000..456b63d0 --- /dev/null +++ b/zenstruck/foundry/2.7/post-install.txt @@ -0,0 +1,4 @@ + * You're ready to use zenstruck/foundry. Create your first factory with + bin/console make:factory. + + * Read the documentation at https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html diff --git a/zenstruck/foundry/2.7/src/Story/AppStory.php b/zenstruck/foundry/2.7/src/Story/AppStory.php new file mode 100644 index 00000000..5cc56577 --- /dev/null +++ b/zenstruck/foundry/2.7/src/Story/AppStory.php @@ -0,0 +1,15 @@ +