Skip to content

Commit 66a1bfb

Browse files
Merge branch '2.7' into 2.8
* 2.7: [php7] Fix for substr() always returning a string [Security] Do not save the target path in the session for a stateless firewall Fix calls to HttpCache#getSurrogate triggering E_USER_DEPRECATED errors. [DependencyInjection] fixed FrozenParameterBag and improved Parameter…
2 parents df7b2e9 + 851e3ff commit 66a1bfb

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)