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] Rename#[InnerService] to#[MapDecorated]#46112

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.1fromchalasr:rename-inner
Apr 22, 2022

Conversation

@chalasr
Copy link
Member

QA
Branch?6.1
Bug fix?no
New feature?no but tweaks one#45834
Deprecations?no
Tickets-
LicenseMIT
Doc PR-

When talking about the decorator pattern outside of Symfony, the terminner is pretty much (if not totally) inexistent. Worse, it makes the concept harder to explain. Take "there is a decorator and a decorated object" vs "there is a decorator and an inner object": using the later form, one has to explain both what is the decorator and what is the inner. While using the former, explaining what the decorator makes it obvious what the decorated is.

I propose to take the addition of this attribute as an opportunity to start making this special term go away.

Also I removed theService suffix. It is tempting to keep it for explicitness, but it feels kinda redundant and AFAIK no other core attribute has such redundant suffix, maybe because their namespace is enough to indicate their target.

@carsonbotcarsonbot added this to the6.1 milestoneApr 19, 2022
@chalasrchalasr changed the title[DependencyInjection] Rename#[InnerService] to `#[Decorated][DependencyInjection] Rename#[InnerService] to#[Decorated]Apr 19, 2022
@chalasrchalasr changed the title[DependencyInjection] Rename#[InnerService] to#[Decorated][DependencyInjection] Rename#[InnerService] to#[MapDecorated]Apr 19, 2022
@chalasrchalasrforce-pushed therename-inner branch 8 times, most recently from512812a to1c7a20aCompareApril 19, 2022 17:12
@fabpot
Copy link
Member

Thank you@chalasr.

@mbrodala
Copy link
Contributor

Just for understanding: whyMapDecorated and not justDecorated? What does themap stand for here?

freiondrej-lmc reacted with thumbs up emoji

@fabpotfabpot mentioned this pull requestApr 27, 2022
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedMay 2, 2022
edited
Loading

"map" stands for "inject" or "wire", or "autowire" to be more precise - but using a more compact word.
It builds on thisMap* convention that we started withhttps://github.com/symfony/symfony/blob/6.1/src/Symfony/Component/HttpKernel/Attribute/MapDateTime.php

@mbrodala
Copy link
Contributor

Ah OK, I was confused by the "other" kind of map (key=>value storage). Thanks for the insights.

@nicolas-grekas
Copy link
Member

this works :)
key = the argument
value = the decorated service

mbrodala reacted with laugh emoji

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

Reviewers

@fabpotfabpotfabpot approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

@dunglasdunglasAwaiting requested review from dunglasdunglas is a code owner

Assignees

No one assigned

Projects

None yet

Milestone

6.1

Development

Successfully merging this pull request may close these issues.

5 participants

@chalasr@fabpot@mbrodala@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp