Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add append fixtures feature to loadFixtures method #384

Merged
merged 1 commit into from Feb 7, 2018

Conversation

almacbe
Copy link
Contributor

@almacbe almacbe commented Jan 21, 2018

Add an optional parameter that allows to append fixtures.

As we talked on #174 I have implemented a proposal for that feature.

@almacbe almacbe force-pushed the append-load-fixtures branch 3 times, most recently from 55c47ac to 6feae49 Compare January 21, 2018 15:42
@alexislefebvre alexislefebvre added this to the 2.0 milestone Jan 21, 2018
@alexislefebvre
Copy link
Collaborator

Adding the option as a second parameter will break many calls to loadFixtures(). But it's consistent with the order of parameters in

public function loadFixtureFiles(array $paths = [], bool $append = false, ?string $omName = null, $registryName = 'doctrine', ?int $purgeMode = null)
So I agree with this change. 👍

@almacbe
Copy link
Contributor Author

almacbe commented Jan 21, 2018

That was my thought

@Jean85
Copy link
Contributor

Jean85 commented Jan 22, 2018

Since this change is breaking BC, we should add this information in the upgrade guide and the changelog (see #382)

@almacbe
Copy link
Contributor Author

almacbe commented Jan 23, 2018

Then, I am sorry but I don't know what I have to do... Do I have to wait? or do I have to modify the files?

@Jean85
Copy link
Contributor

Jean85 commented Jan 23, 2018

It's up to @alexislefebvre or @lsmith77 to decide if they want to merge this and do it later, or merge #382 and do it now in this same PR..

@Jean85
Copy link
Contributor

Jean85 commented Jan 23, 2018

#382 is merged, you can pull from the target branch and add info in those files now! 👍

@almacbe
Copy link
Contributor Author

almacbe commented Jan 30, 2018

I have updated the doc, changelog and update guide. I hope my English is good enough.

@almacbe
Copy link
Contributor Author

almacbe commented Feb 5, 2018

@Jean85 Do I have to change or do something more?

Copy link
Contributor

@Jean85 Jean85 left a comment

Choose a reason for hiding this comment

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

LGTM 👍 it's up to the maintainer to decide if they want to merge this or not.

UPGRADE-2.0.md Outdated
@@ -8,3 +8,7 @@ This is the list of actions that you need to take when upgrading this bundle fro
composer remove --dev nelmio/alice
composer require --dev liip/functional-test-bundle "~2.0"
```

* It had been changed the interface of `LoadFixtures` to allow append fixtures. The main difference is it had been added
Copy link
Contributor

@lsmith77 lsmith77 Feb 5, 2018

Choose a reason for hiding this comment

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

just a small wording tweak

The interface of `LoadFixtures` had to be changed to allow append fixtures. The main difference is that a boolean second parameter has been added. You will have to add it and set it to `false` if you have changed the default manager, driver or purge mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lsmith77 Thanks, it is sorted.

* @param string $omName The name of object manager to use
* @param string $registryName The service id of manager registry to use
* @param int $purgeMode Sets the ORM purge mode
*
* @return null|AbstractExecutor
*/
protected function loadFixtures(array $classNames = [], ?string $omName = null, string $registryName = 'doctrine', ?int $purgeMode = null): ?AbstractExecutor
protected function loadFixtures(array $classNames = [], bool $append = false, ?string $omName = null, string $registryName = 'doctrine', ?int $purgeMode = null): ?AbstractExecutor
Copy link
Contributor

Choose a reason for hiding this comment

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

generally this method has too many parameters already from my point of view. it would be good to think about how to refactor it to have less parameters.

Copy link
Contributor

Choose a reason for hiding this comment

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

Since we are targeting 2.x and BC are allowed, it's a good moment to do that, yes! 👍

Copy link
Contributor Author

@almacbe almacbe Feb 5, 2018

Choose a reason for hiding this comment

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

But, does it have to be in this PR or another one?

@almacbe
Copy link
Contributor Author

almacbe commented Feb 7, 2018

Do I have to do or change something? @lsmith77 @Jean85

@Jean85
Copy link
Contributor

Jean85 commented Feb 7, 2018

LGTM, I would approach something to simplify the signature in a different PR... Maybe I have something in mind.

@lsmith77
Copy link
Contributor

lsmith77 commented Feb 7, 2018

@alexislefebvre if this approach is ok for you, then I can live with it .. we should just immediate start this follow up PR or at least create a ticket and someone should feel somewhat responsible for taking it on.

@alexislefebvre alexislefebvre merged commit acaaadf into liip:2.x Feb 7, 2018
@alexislefebvre
Copy link
Collaborator

alexislefebvre commented Feb 7, 2018

I prefer that we refactor loadFixtures() and loadFixtureFiles() in another PR too.

@Jean85 You looked interested, feel free to open an issue or a PR about this refactor. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants