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 support for defining factory parameters #428

Closed
wants to merge 12 commits into from

Conversation

predakanga
Copy link
Contributor

@predakanga predakanga commented Jul 9, 2016

Fixes #362, matches your method name conventions, etc wherever possible

@mnapoli
Copy link
Member

mnapoli commented Jul 9, 2016

Hi! That looks really good! I have a few comments, I'll put them in the diff directly.

*
* @return FactoryDefinitionHelper
*/
public function factoryParameter($parameter, $value)
Copy link
Member

@mnapoli mnapoli Jul 9, 2016

Choose a reason for hiding this comment

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

I think factory(MyFactory::class)->parameter('foo', 'bar') would be simpler than factory(MyFactory::class)->factoryParameter('foo', 'bar').

Copy link
Contributor Author

@predakanga predakanga Jul 10, 2016

Choose a reason for hiding this comment

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

Happy to change it - I initially wrote it as ->parameter, changed it to ->factoryParameter to match methodParameter and constructorParameter

@mnapoli mnapoli added this to the 5.4 milestone Jul 9, 2016
@mnapoli
Copy link
Member

mnapoli commented Jul 9, 2016

This is a really great pull request! Could you add a few functional test cases (here)?

@mnapoli
Copy link
Member

mnapoli commented Jul 9, 2016

Oops almost forgot: could you update the documentation here too: https://github.com/PHP-DI/PHP-DI/blob/master/doc/php-definitions.md#factories

@predakanga
Copy link
Contributor Author

predakanga commented Jul 10, 2016

Hey, thanks for the feedback!

I'll update the PR shortly, though I'm not sure if rebasing will need me to create a new one - I selected to merge into PHP-DI:5.3 instead of master.

@mnapoli
Copy link
Member

mnapoli commented Jul 10, 2016

Is there a reason you wanted to merge that into 5.3? To me it's a big feature, it deserves a minor version so it should go in master so that we can release it as 5.4. I'm afraid you'll have to close this one and reopen a new one though, I don't think you can edit the target branch?

I had a look at the latest commits and the docs + new tests are awesome!

@predakanga
Copy link
Contributor Author

predakanga commented Jul 10, 2016

There's no real reason to merge it into 5.3, I just made the initial fork from there.

I'm rebasing it now, I'll open a new PR with that.

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

Successfully merging this pull request may close these issues.

None yet

2 participants