8000 Merge branch '2.3' into 2.7 · symfony/dependency-injection@851e3ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 851e3ff

Browse files
Merge branch '2.3' into 2.7
* 2.3: [php7] Fix for substr() always returning a string [Security] Do not save the target path in the session for a stateless firewall [DependencyInjection] fixed FrozenParameterBag and improved Parameter… Conflicts: src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
2 parents b7fb8d4 + 2d2f7fd commit 851e3ff

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

ParameterBag/ParameterBagInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\DependencyInjection\ParameterBag;
1313

14+
use Symfony\Component\DependencyInjection\Exception\LogicException;
1415
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
1516

1617
/**
@@ -25,6 +26,8 @@ interface ParameterBagInterface
2526
/**
2627
* Clears all parameters.
2728
*
29+
* @throws LogicException if the ParameterBagInterface can not be cleared
30+
*
2831
* @api
2932
*/
3033
public function clear();
@@ -34,6 +37,8 @@ public function clear();
3437
*
3538
* @param array $parameters An array of parameters
3639
*
40+
* @throws LogicException if the parameter can not be added
41+
*
3742
* @api
3843
*/
3944
public function add(array $parameters);
@@ -66,6 +71,8 @@ public function get($name);
6671
* @param string $name The parameter name
6772
* @param mixed $value The parameter value
6873
*
74+
* @throws LogicException if the parameter can not be set
75+
*
6976
* @api
7077
*/
7178
public function set($name, $value);

Tests/ParameterBag/FrozenParameterBagTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,13 @@ public function testAdd()
5757
$bag = new FrozenParameterBag(array());
5858
$bag->add(array());
5959
}
60+
61+
/**
62+
* @expectedException \LogicException
63+
*/
64+
public function testRemove()
65+
{
66+
$bag = new FrozenParameterBag(array('foo' => 'bar'));
67+
$bag->remove('foo');
68+
}
6069
}

0 commit comments

Comments
 (0)
0