🌐 AI搜索 & 代理 主页
Skip to content

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
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