From f82641ad6a4e2946d3867439c5f05df3db2756e6 Mon Sep 17 00:00:00 2001 From: Kevin Bond Date: Mon, 30 Aug 2021 07:51:36 -0400 Subject: [PATCH] [doc] update symfony.com links --- README.md | 4 ++-- docs/index.rst | 4 ++-- .../DependencyInjection/Configuration.php | 2 +- src/Bundle/Maker/MakeFactory.php | 2 +- src/Bundle/Maker/MakeStory.php | 2 +- src/Bundle/Resources/skeleton/Factory.tpl.php | 6 ++--- src/Bundle/Resources/skeleton/Story.tpl.php | 2 +- src/Instantiator.php | 4 ++-- src/Proxy.php | 2 +- .../Bundle/Maker/MakeFactoryTest.php | 24 +++++++++---------- .../Functional/Bundle/Maker/MakeStoryTest.php | 8 +++---- tests/Unit/InstantiatorTest.php | 12 +++++----- 12 files changed, 36 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index e2dc4ace9..55c9a88dd 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,12 @@ $post = PostFactory::new() // Create the factory for Post objects ; ``` -The factories can be used inside [DoctrineFixturesBundle](https://symfony.com/doc/master/bundles/DoctrineFixturesBundle/index.html) +The factories can be used inside [DoctrineFixturesBundle](https://symfony.com/bundles/DoctrineFixturesBundle/current/index.html) to load fixtures or inside your tests, [where it has even more features](#using-in-your-tests). Want to watch a screencast 🎥 about it? Check out https://symfonycasts.com/foundry -**[Read the Documentation](https://symfony.com/bundles/foundry/current/index.html)** +**[Read the Documentation](https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html)** ## Credit diff --git a/docs/index.rst b/docs/index.rst index 1f0e875f7..1390189cd 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,7 +9,7 @@ Installation $ composer require zenstruck/foundry --dev To use the ``make:*`` commands from this bundle, ensure -`Symfony MakerBundle `_ is installed. +`Symfony MakerBundle `_ is installed. *If not using Symfony Flex, be sure to enable the bundle in your **test**/**dev** environments.* @@ -913,7 +913,7 @@ Now, after creating objects using this factory, you'd have to call ``->save()`` Using with DoctrineFixturesBundle --------------------------------- -Foundry works out of the box with `DoctrineFixturesBundle `_. +Foundry works out of the box with `DoctrineFixturesBundle `_. You can simply use your factories and stories right within your fixture files: .. code-block:: php diff --git a/src/Bundle/DependencyInjection/Configuration.php b/src/Bundle/DependencyInjection/Configuration.php index d6359caab..bd50417e1 100644 --- a/src/Bundle/DependencyInjection/Configuration.php +++ b/src/Bundle/DependencyInjection/Configuration.php @@ -17,7 +17,7 @@ public function getConfigTreeBuilder(): TreeBuilder $treeBuilder->getRootNode() ->children() ->booleanNode('auto_refresh_proxies') - ->info('Whether to auto-refresh proxies by default (https://symfony.com/bundles/foundry/current/index.html#auto-refresh)') + ->info('Whether to auto-refresh proxies by default (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh)') ->defaultNull() ->end() ->arrayNode('faker') diff --git a/src/Bundle/Maker/MakeFactory.php b/src/Bundle/Maker/MakeFactory.php index 4788e20e6..4954423ec 100644 --- a/src/Bundle/Maker/MakeFactory.php +++ b/src/Bundle/Maker/MakeFactory.php @@ -155,7 +155,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen $io->text([ 'Next: Open your new factory and set default values/states.', - 'Find the documentation at https://symfony.com/bundles/foundry/current/index.html#model-factories', + 'Find the documentation at https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories', ]); } diff --git a/src/Bundle/Maker/MakeStory.php b/src/Bundle/Maker/MakeStory.php index 099d9f6db..a332a635a 100644 --- a/src/Bundle/Maker/MakeStory.php +++ b/src/Bundle/Maker/MakeStory.php @@ -75,7 +75,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen $io->text([ 'Next: Open your story class and start customizing it.', - 'Find the documentation at https://symfony.com/bundles/foundry/current/index.html#stories', + 'Find the documentation at https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#stories', ]); } diff --git a/src/Bundle/Resources/skeleton/Factory.tpl.php b/src/Bundle/Resources/skeleton/Factory.tpl.php index 7c09d955c..c0040e933 100644 --- a/src/Bundle/Resources/skeleton/Factory.tpl.php +++ b/src/Bundle/Resources/skeleton/Factory.tpl.php @@ -34,13 +34,13 @@ public function __construct() { parent::__construct(); - // TODO inject services if required (https://symfony.com/bundles/foundry/current/index.html#factories-as-services) + // TODO inject services if required (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services) } protected function getDefaults(): array { return [ - // TODO add your default values here (https://symfony.com/bundles/foundry/current/index.html#model-factories) + // TODO add your default values here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories) $type) { echo " '".$fieldname."' => ".$type."\n"; @@ -51,7 +51,7 @@ protected function getDefaults(): array protected function initialize(): self { - // see https://symfony.com/bundles/foundry/current/index.html#initialization + // see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization return $this // ->afterInstantiate(function(getShortName() ?> $getShortName()) ?>) {}) ; diff --git a/src/Bundle/Resources/skeleton/Story.tpl.php b/src/Bundle/Resources/skeleton/Story.tpl.php index e5cc68bf6..faccb90ab 100644 --- a/src/Bundle/Resources/skeleton/Story.tpl.php +++ b/src/Bundle/Resources/skeleton/Story.tpl.php @@ -8,6 +8,6 @@ final class extends Story { public function build(): void { - // TODO build your story here (https://symfony.com/bundles/foundry/current/index.html#stories) + // TODO build your story here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#stories) } } diff --git a/src/Instantiator.php b/src/Instantiator.php index 698fecaa2..73616b11f 100644 --- a/src/Instantiator.php +++ b/src/Instantiator.php @@ -35,7 +35,7 @@ public function __invoke(array $attributes, string $class): object foreach ($attributes as $attribute => $value) { if (0 === \mb_strpos($attribute, 'optional:')) { - trigger_deprecation('zenstruck\foundry', '1.5.0', 'Using "optional:" attribute prefixes is deprecated, use Instantiator::allowExtraAttributes() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + trigger_deprecation('zenstruck\foundry', '1.5.0', 'Using "optional:" attribute prefixes is deprecated, use Instantiator::allowExtraAttributes() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); continue; } @@ -56,7 +56,7 @@ public function __invoke(array $attributes, string $class): object } if (0 === \mb_strpos($attribute, 'force:')) { - trigger_deprecation('zenstruck\foundry', '1.5.0', 'Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + trigger_deprecation('zenstruck\foundry', '1.5.0', 'Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); self::forceSet($object, \mb_substr($attribute, 6), $value); diff --git a/src/Proxy.php b/src/Proxy.php index a8a962d4f..fe60dea65 100644 --- a/src/Proxy.php +++ b/src/Proxy.php @@ -121,7 +121,7 @@ public function object(): object $om->getUnitOfWork()->computeChangeSet($om->getClassMetadata($this->class), $this->object); if (!empty($om->getUnitOfWork()->getEntityChangeSet($this->object))) { - throw new \RuntimeException(\sprintf('Cannot auto refresh "%s" as there are unsaved changes. Be sure to call ->save() or disable auto refreshing (see https://symfony.com/bundles/foundry/current/index.html#auto-refresh for details).', $this->class)); + throw new \RuntimeException(\sprintf('Cannot auto refresh "%s" as there are unsaved changes. Be sure to call ->save() or disable auto refreshing (see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#auto-refresh for details).', $this->class)); } } diff --git a/tests/Functional/Bundle/Maker/MakeFactoryTest.php b/tests/Functional/Bundle/Maker/MakeFactoryTest.php index 0effd4c81..b5e3dd41e 100644 --- a/tests/Functional/Bundle/Maker/MakeFactoryTest.php +++ b/tests/Functional/Bundle/Maker/MakeFactoryTest.php @@ -57,20 +57,20 @@ public function __construct() { parent::__construct(); - // TODO inject services if required (https://symfony.com/bundles/foundry/current/index.html#factories-as-services) + // TODO inject services if required (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services) } protected function getDefaults(): array { return [ - // TODO add your default values here (https://symfony.com/bundles/foundry/current/index.html#model-factories) + // TODO add your default values here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories) 'name' => self::faker()->text(), ]; } protected function initialize(): self { - // see https://symfony.com/bundles/foundry/current/index.html#initialization + // see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization return \$this // ->afterInstantiate(function(Category \$category) {}) ; @@ -135,20 +135,20 @@ public function __construct() { parent::__construct(); - // TODO inject services if required (https://symfony.com/bundles/foundry/current/index.html#factories-as-services) + // TODO inject services if required (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services) } protected function getDefaults(): array { return [ - // TODO add your default values here (https://symfony.com/bundles/foundry/current/index.html#model-factories) + // TODO add your default values here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories) 'name' => self::faker()->text(), ]; } protected function initialize(): self { - // see https://symfony.com/bundles/foundry/current/index.html#initialization + // see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization return \$this // ->afterInstantiate(function(Tag \$tag) {}) ; @@ -209,20 +209,20 @@ public function __construct() { parent::__construct(); - // TODO inject services if required (https://symfony.com/bundles/foundry/current/index.html#factories-as-services) + // TODO inject services if required (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services) } protected function getDefaults(): array { return [ - // TODO add your default values here (https://symfony.com/bundles/foundry/current/index.html#model-factories) + // TODO add your default values here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories) 'name' => self::faker()->text(), ]; } protected function initialize(): self { - // see https://symfony.com/bundles/foundry/current/index.html#initialization + // see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization return \$this // ->afterInstantiate(function(Category \$category) {}) ; @@ -287,20 +287,20 @@ public function __construct() { parent::__construct(); - // TODO inject services if required (https://symfony.com/bundles/foundry/current/index.html#factories-as-services) + // TODO inject services if required (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#factories-as-services) } protected function getDefaults(): array { return [ - // TODO add your default values here (https://symfony.com/bundles/foundry/current/index.html#model-factories) + // TODO add your default values here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#model-factories) 'name' => self::faker()->text(), ]; } protected function initialize(): self { - // see https://symfony.com/bundles/foundry/current/index.html#initialization + // see https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#initialization return \$this // ->afterInstantiate(function(Tag \$tag) {}) ; diff --git a/tests/Functional/Bundle/Maker/MakeStoryTest.php b/tests/Functional/Bundle/Maker/MakeStoryTest.php index 62b080da1..980ed5c97 100644 --- a/tests/Functional/Bundle/Maker/MakeStoryTest.php +++ b/tests/Functional/Bundle/Maker/MakeStoryTest.php @@ -34,7 +34,7 @@ final class FooBarStory extends Story { public function build(): void { - // TODO build your story here (https://symfony.com/bundles/foundry/current/index.html#stories) + // TODO build your story here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#stories) } } @@ -70,7 +70,7 @@ final class FooBarStory extends Story { public function build(): void { - // TODO build your story here (https://symfony.com/bundles/foundry/current/index.html#stories) + // TODO build your story here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#stories) } } @@ -103,7 +103,7 @@ final class FooBarStory extends Story { public function build(): void { - // TODO build your story here (https://symfony.com/bundles/foundry/current/index.html#stories) + // TODO build your story here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#stories) } } @@ -139,7 +139,7 @@ final class FooBarStory extends Story { public function build(): void { - // TODO build your story here (https://symfony.com/bundles/foundry/current/index.html#stories) + // TODO build your story here (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#stories) } } diff --git a/tests/Unit/InstantiatorTest.php b/tests/Unit/InstantiatorTest.php index e91da48fe..65a475a86 100644 --- a/tests/Unit/InstantiatorTest.php +++ b/tests/Unit/InstantiatorTest.php @@ -167,7 +167,7 @@ public function extra_attributes_not_defined_throws_exception(): void */ public function can_prefix_extra_attribute_key_with_optional_to_avoid_exception(): void { - $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "optional:" attribute prefixes is deprecated, use Instantiator::allowExtraAttributes() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "optional:" attribute prefixes is deprecated, use Instantiator::allowExtraAttributes() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); $object = (new Instantiator())([ 'propB' => 'B', @@ -229,7 +229,7 @@ public function can_set_attributes_that_should_be_force_set(): void */ public function prefixing_attribute_key_with_force_sets_the_property_directly(): void { - $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); $object = (new Instantiator())([ 'propA' => 'A', @@ -251,7 +251,7 @@ public function prefixing_attribute_key_with_force_sets_the_property_directly(): */ public function prefixing_snake_case_attribute_key_with_force_sets_the_property_directly(): void { - $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); $object = (new Instantiator())([ 'prop_a' => 'A', @@ -273,7 +273,7 @@ public function prefixing_snake_case_attribute_key_with_force_sets_the_property_ */ public function prefixing_kebab_case_attribute_key_with_force_sets_the_property_directly(): void { - $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); $object = (new Instantiator())([ 'prop-a' => 'A', @@ -295,7 +295,7 @@ public function prefixing_kebab_case_attribute_key_with_force_sets_the_property_ */ public function prefixing_invalid_attribute_key_with_force_throws_exception(): void { - $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "force:" property prefixes is deprecated, use Instantiator::alwaysForceProperties() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Class "Zenstruck\Foundry\Tests\Unit\InstantiatorDummy" does not have property "extra".'); @@ -457,7 +457,7 @@ public function always_force_mode_throws_exception_for_extra_attributes(): void */ public function always_force_mode_allows_optional_attribute_name_prefix(): void { - $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "optional:" attribute prefixes is deprecated, use Instantiator::allowExtraAttributes() instead (https://symfony.com/bundles/foundry/current/index.html#instantiation).'); + $this->expectDeprecation('Since zenstruck\foundry 1.5.0: Using "optional:" attribute prefixes is deprecated, use Instantiator::allowExtraAttributes() instead (https://symfony.com/bundles/ZenstruckFoundryBundle/current/index.html#instantiation).'); $object = (new Instantiator())->alwaysForceProperties()([ 'propB' => 'B',