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

Commit6c00f60

Browse files
committed
[SecurityBundle] Rename FirewallContext#getContext()
1 parenta559036 commit6c00f60

File tree

5 files changed

+42
-8
lines changed

5 files changed

+42
-8
lines changed

‎UPGRADE-3.2.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ FrameworkBundle
2828
* The`Resources/public/css/*.css` files have been removed (they are now inlined
2929
in TwigBundle).
3030

31+
SecurityBundle
32+
--------------
33+
34+
* The`FirewallContext::getContext()` method has been deprecated and will be removed in 4.0.
35+
Use the`getListeners()` method instead.
36+
3137
Console
3238
-------
3339

‎UPGRADE-4.0.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ FrameworkBundle
131131
`serializer.mapping.cache.apc` and`serializer.mapping.cache.doctrine.apc`
132132
have been removed. APCu should now be automatically used when available.
133133

134+
SecurityBundle
135+
--------------
136+
137+
* The`FirewallContext::getContext()` method has been removed, use the`getListeners()` method instead.
138+
134139
HttpFoundation
135140
---------------
136141

‎src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,17 @@ public function getConfig()
4141
return$this->config;
4242
}
4343

44+
/**
45+
* @deprecated since version 3.2, will be removed in 4.0. Use {@link getListeners()} instead.
46+
*/
4447
publicfunctiongetContext()
48+
{
49+
@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);
50+
51+
return$this->getListeners();
52+
}
53+
54+
publicfunctiongetListeners()
4555
{
4656
returnarray($this->listeners,$this->exceptionListener);
4757
}

‎src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getListeners(Request $request)
4646
returnarray(array(),null);
4747
}
4848

49-
return$context->getContext();
49+
return$context->getListeners();
5050
}
5151

5252
/**

‎src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php‎

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@ class FirewallContextTest extends \PHPUnit_Framework_TestCase
2121
publicfunctiontestGetters()
2222
{
2323
$config =newFirewallConfig('main','request_matcher','user_checker');
24-
25-
$exceptionListener =$this
26-
->getMockBuilder(ExceptionListener::class)
27-
->disableOriginalConstructor()
28-
->getMock();
29-
24+
$exceptionListener =$this->getExceptionListenerMock();
3025
$listeners =array(
3126
$this
3227
->getMockBuilder(ListenerInterface::class)
@@ -36,7 +31,25 @@ public function testGetters()
3631

3732
$context =newFirewallContext($listeners,$exceptionListener,$config);
3833

39-
$this->assertEquals(array($listeners,$exceptionListener),$context->getContext());
34+
$this->assertEquals(array($listeners,$exceptionListener),$context->getListeners());
4035
$this->assertEquals($config,$context->getConfig());
4136
}
37+
38+
/**
39+
* @expectedDeprecation Method Symfony\Bundle\SecurityBundle\Security\FirewallContext::getContext() is deprecated since version 3.2 and will be removed in 4.0. Use Symfony\Bundle\SecurityBundle\Security\FirewallContext::getListeners() instead.
40+
* @group legacy
41+
*/
42+
publicfunctiontestGetContextTriggersDeprecation()
43+
{
44+
(newFirewallContext(array(),$this->getExceptionListenerMock(),newFirewallConfig('main','request_matcher','user_checker')))
45+
->getContext();
46+
}
47+
48+
privatefunctiongetExceptionListenerMock()
49+
{
50+
return$this
51+
->getMockBuilder(ExceptionListener::class)
52+
->disableOriginalConstructor()
53+
->getMock();
54+
}
4255
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp