Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DI] Allow autoconfigured calls in PHP #26768

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

Merged
merged 4 commits into from
Apr 20, 2018

Conversation

GaryPEGEOT
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

Allow to auto-configured method calls like:

$container->registerForAutoconfiguration(LoggerAwareInterface::class)->addMethodCall('setLogger', array(new Reference(LoggerInterface::class)));

@GaryPEGEOT GaryPEGEOT changed the title Allow autoconfigured calls in PHP. [DI] Allow autoconfigured calls in PHP. Apr 3, 2018
@nicolas-grekas nicolas-grekas changed the title [DI] Allow autoconfigured calls in PHP. [DI] Allow autoconfigured calls in PHP Apr 3, 2018
@nicolas-grekas nicolas-grekas added this to the 4.1 milestone Apr 3, 2018
@GaryPEGEOT GaryPEGEOT force-pushed the feature/autoconfigure-calls branch from b75f4d1 to 71bf3ce Compare April 3, 2018 21:22
@GaryPEGEOT
Copy link
Contributor Author

@nicolas-grekas I can't reproduce the error in Framework Bundle (Travis pipeline), tests are OK when I run them. Any idea ?

@nicolas-grekas
Copy link
Member

LGTM.
Can you just add a test with the same method being defined manually AND via instanceof?
(it should be called twice: first by the instanceof, 2nd by the manual definition, isn't it?)

@GaryPEGEOT
Copy link
Contributor Author

Added in 1d811cb

@fabpot
Copy link
Member

fabpot commented Apr 20, 2018

Thank you @GaryPEGEOT.

@fabpot fabpot merged commit 1d811cb into symfony:master Apr 20, 2018
fabpot added a commit that referenced this pull request Apr 20, 2018
…aryPEGEOT)

This PR was merged into the 4.1-dev branch.

Discussion
----------

[DI] Allow autoconfigured calls in PHP

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    |no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Allow to auto-configured method calls like:
```php
$container->registerForAutoconfiguration(LoggerAwareInterface::class)->addMethodCall('setLogger', array(new Reference(LoggerInterface::class)));
```

Commits
-------

1d811cb Add test for both _intanceof and manual method setting.
71bf3ce CS fix
15c45ee Add more test-cases
2612f81 Allow autoconfigured calls in PHP.
@fabpot fabpot mentioned this pull request May 7, 2018
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.

4 participants