Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DependencyInjection] Allow service subscribers to returnSubscribedService[]#47101

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:6.2fromkbond:service-subscriber-improvements
Aug 19, 2022

Conversation

@kbond
Copy link
Member

@kbondkbond commentedJul 28, 2022
edited
Loading

QA
Branch?6.2
Bug fix?no
New feature?yes
Deprecations?no
Ticketsn/a
LicenseMIT
Doc PRtodo

This allowsServiceSubscriberInterface::getSubscribedServices() to returnSubscribedService[] which now has the ability to add DI attribute objects (ieTarget).

publicstaticfunctiongetSubscribedServices():array{return [newSubscribedService('logger',Psr\Log\LoggerInterface::class),newSubscribedService(type:Psr\Log\LoggerInterface::class, nullable:true),newSubscribedService('http_client', HttpClientInterface::class, attributes:newTarget('githubApi'))),    ];}

When using theServiceSubscriberTrait, theSubscribedService attribute can add attributes as well:

#[SubscribedService(attributes:newTarget('githubApi'))]privatefunctionhttpClient(): ?HttpClientInterface{return$this->container->get(__METHOD__);}

TODO:

  • Implementation
  • Tests
  • Changelog

@carsonbotcarsonbot added this to the6.2 milestoneJul 28, 2022
@carsonbotcarsonbot changed the title[WIP][DI] AllowServiceSubscriberInterface::getSubscribedServices() to returnSubscribedService[][DependencyInjection] [WIP] AllowServiceSubscriberInterface::getSubscribedServices() to returnSubscribedService[]Jul 28, 2022
@kbondkbond changed the title[DependencyInjection] [WIP] AllowServiceSubscriberInterface::getSubscribedServices() to returnSubscribedService[][DependencyInjection] [WIP] Allow service subscribers to returnSubscribedService[]Jul 28, 2022
@kbondkbondforce-pushed theservice-subscriber-improvements branch 3 times, most recently fromdfdeb74 to263acddCompareJuly 28, 2022 16:51
@nicolas-grekas
Copy link
Member

I like it :) Let's see how DI can leverage that for Autowiring now.

@kbondkbondforce-pushed theservice-subscriber-improvements branch 2 times, most recently from11073d1 to29ab4b0CompareAugust 16, 2022 16:02
@kbondkbond requested a review fromdunglas as acode ownerAugust 16, 2022 16:02
@kbondkbondforce-pushed theservice-subscriber-improvements branch from29ab4b0 to0fb543fCompareAugust 16, 2022 16:03
@kbondkbondforce-pushed theservice-subscriber-improvements branch 2 times, most recently from25882d6 toaa868d8CompareAugust 16, 2022 16:21
@kbondkbondforce-pushed theservice-subscriber-improvements branch fromaa868d8 toc90f7f3CompareAugust 16, 2022 19:12
@kbondkbond changed the title[DependencyInjection] [WIP] Allow service subscribers to returnSubscribedService[][DependencyInjection] Allow service subscribers to returnSubscribedService[]Aug 16, 2022
@kbondkbondforce-pushed theservice-subscriber-improvements branch 3 times, most recently fromd921b76 to2babe71CompareAugust 16, 2022 20:38
@kbondkbondforce-pushed theservice-subscriber-improvements branch from2babe71 to8ed139eCompareAugust 17, 2022 14:04
@nicolas-grekasnicolas-grekasforce-pushed theservice-subscriber-improvements branch from6a125e3 to7785a60CompareAugust 18, 2022 07:49
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

(I made some changes, see 2nd commit)

kbond reacted with heart emoji
@fabpotfabpotforce-pushed theservice-subscriber-improvements branch from7785a60 to049f15eCompareAugust 19, 2022 13:41
@fabpot
Copy link
Member

Thank you@kbond.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@stofstofstof left review comments

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

6.2

Development

Successfully merging this pull request may close these issues.

5 participants

@kbond@nicolas-grekas@fabpot@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp