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

[SecurityBundle] Rename FirewallContext#getContext()#20417

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

Conversation

@chalasr
Copy link
Member

@chalasrchalasr commentedNov 5, 2016
edited
Loading

QA
Branch?master
Bug fix?no
New feature?no
BC breaks?no
Deprecations?yes
Tests pass?yes
Fixed ticketsn/a
LicenseMIT
Doc PRn/a

As pointed out in#19398 (comment), the name of this method is misleading.
Because a public service using this class is created for each defined firewall, I suggest to change it toFirewallContext#getListeners(), deprecating the currentgetContext() for removing it in 4.0.

ro0NL, linaori, FabienPapet, ogizanagi, and yceruto reacted with thumbs up emoji
@FabienPapet
Copy link

Shouldn't the UPGRADE-4.0.md file be updated as well ?

@chalasr
Copy link
MemberAuthor

@FabienPapet You're right, thought I'm not sure upgrade files are not automatically generated from merged commits, changelog ones seem to be so let's get the confirmation of a core team member

@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch from033da86 to9482521CompareNovember 5, 2016 15:43
@Taluu
Copy link
Contributor

AFAIK, you need to update it

@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch from9482521 toca99176CompareNovember 5, 2016 21:32
@chalasr
Copy link
MemberAuthor

UPGRADE updated. Thanks

@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch fromca99176 to6b889f0CompareNovember 5, 2016 21:34
@javiereguiluzjaviereguiluz added this to the3.2 milestoneNov 7, 2016
*/
publicfunctiongetContext()
{
@trigger_error(sprintf('Method "%s()" is deprecated since version 3.2 and will be removed in 4.0. Use "%s::getListeners()" instead.',__METHOD__,__CLASS__),E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

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

The %() method is [...]

@xabbuh
Copy link
Member

👍

@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch 3 times, most recently from6c00f60 tob6a29b2CompareNovember 7, 2016 20:17
@fabpotfabpot removed this from the3.2 milestoneNov 16, 2016
@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch fromb6a29b2 to03b330cCompareNovember 20, 2016 10:18
@chalasr
Copy link
MemberAuthor

Updated to target 3.3

@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch 3 times, most recently fromd309b18 toe91f331CompareNovember 24, 2016 19:48
@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch frome91f331 tof09a056CompareNovember 24, 2016 23:47
@nicolas-grekasnicolas-grekas added this to the3.x milestoneDec 6, 2016
@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch fromf09a056 tofe775e5CompareDecember 8, 2016 22:43
@chalasrchalasrforce-pushed thesecuritybundle/deprecate_firewallcontext-getcontext branch fromfe775e5 toee66b49CompareDecember 8, 2016 22:44
@chalasr
Copy link
MemberAuthor

This is ready to go

SecurityBundle
--------------

* The`FirewallContext::getContext()` method has been removed, use the`getListeners()` method instead.
Copy link
Member

Choose a reason for hiding this comment

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

looks like this line could be wrapped to be in line with the other lines in the file

@fabpot
Copy link
Member

Thank you@chalasr.

@fabpotfabpot merged commitee66b49 intosymfony:masterDec 9, 2016
fabpot added a commit that referenced this pull requestDec 9, 2016
…chalasr)This PR was merged into the 3.3-dev branch.Discussion----------[SecurityBundle] Rename FirewallContext#getContext()| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | yes| Tests pass?   | yes| Fixed tickets | n/a| License       | MIT| Doc PR        | n/aAs pointed out in#19398 (comment), the name of this method is misleading.Because a public service using this class is created for each defined firewall, I suggest to change it to `FirewallContext#getListeners()`, deprecating the current `getContext()` for removing it in 4.0.Commits-------ee66b49 [SecurityBundle] Rename FirewallContext#getContext()
@chalasrchalasr deleted the securitybundle/deprecate_firewallcontext-getcontext branchDecember 9, 2016 08:37
return$this->getListeners();
}

publicfunctiongetListeners()
Copy link
Member

Choose a reason for hiding this comment

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

this is a bit confusing considering that this returns both an array of listeners and an exception listener.getListeners may be expected to return just$this->listeners

publicfunctiontestGetContextTriggersDeprecation()
{
(newFirewallContext(array(),$this->getExceptionListenerMock(),newFirewallConfig('main','request_matcher','user_checker')))
->getContext();
Copy link
Member

Choose a reason for hiding this comment

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

you should also assert the return value, to ensure that the BC layer works fine (returning null would make your test pass, but the class would be broken)

chalasr reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas modified the milestones:3.x,3.3Mar 24, 2017
fabpot added a commit that referenced this pull requestApr 26, 2017
… (ro0NL)This PR was merged into the 3.3-dev branch.Discussion----------[SecurityBundle] Enhance FirewallContext::getListeners()| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#20417 (comment),#20417 (comment)| License       | MIT| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->I think@stof is right.. and the fact we can do this on master currently without the hassle.cc@chalasrCommits-------ba65078 [SecurityBundle] Enhance FirewallContext::getListeners()
symfony-splitter pushed a commit to symfony/security-bundle that referenced this pull requestApr 26, 2017
… (ro0NL)This PR was merged into the 3.3-dev branch.Discussion----------[SecurityBundle] Enhance FirewallContext::getListeners()| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |symfony/symfony#20417 (comment),symfony/symfony#20417 (comment)| License       | MIT| Doc PR        | symfony/symfony-docs#... <!--highly recommended for new features-->I think@stof is right.. and the fact we can do this on master currently without the hassle.cc@chalasrCommits-------ba650783f5 [SecurityBundle] Enhance FirewallContext::getListeners()
@fabpotfabpot mentioned this pull requestMay 1, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@xabbuhxabbuhxabbuh approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

9 participants

@chalasr@FabienPapet@Taluu@xabbuh@fabpot@stof@javiereguiluz@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp