Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\DependencyInjection\ParameterBag; Chris@0: Chris@0: use Symfony\Component\DependencyInjection\Exception\LogicException; Chris@0: Chris@0: /** Chris@0: * Holds read-only parameters. Chris@0: * Chris@0: * @author Fabien Potencier Chris@0: */ Chris@0: class FrozenParameterBag extends ParameterBag Chris@0: { Chris@0: /** Chris@0: * For performance reasons, the constructor assumes that Chris@0: * all keys are already lowercased. Chris@0: * Chris@0: * This is always the case when used internally. Chris@0: * Chris@0: * @param array $parameters An array of parameters Chris@0: */ Chris@17: public function __construct(array $parameters = []) Chris@0: { Chris@0: $this->parameters = $parameters; Chris@0: $this->resolved = true; Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function clear() Chris@0: { Chris@0: throw new LogicException('Impossible to call clear() on a frozen ParameterBag.'); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function add(array $parameters) Chris@0: { Chris@0: throw new LogicException('Impossible to call add() on a frozen ParameterBag.'); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function set($name, $value) Chris@0: { Chris@0: throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); Chris@0: } Chris@0: Chris@0: /** Chris@0: * {@inheritdoc} Chris@0: */ Chris@0: public function remove($name) Chris@0: { Chris@0: throw new LogicException('Impossible to call remove() on a frozen ParameterBag.'); Chris@0: } Chris@0: }