This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DependencyInjection/ParameterBag/FrozenParameterBag.php

59 lines
1.3 KiB
PHP
Raw Normal View History

2010-06-27 17:28:29 +01:00
<?php
/*
* This file is part of the Symfony package.
2010-06-27 17:28:29 +01:00
*
* (c) Fabien Potencier <fabien@symfony.com>
2010-06-27 17:28:29 +01:00
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
2010-06-27 17:28:29 +01:00
*/
namespace Symfony\Component\DependencyInjection\ParameterBag;
2010-06-27 17:28:29 +01:00
/**
2011-04-15 20:12:02 +01:00
*
* @author Fabien Potencier <fabien@symfony.com>
2010-06-27 17:28:29 +01:00
*/
class FrozenParameterBag extends ParameterBag
{
/**
* Constructor.
*
* For performance reasons, the constructor assumes that
* all keys are already lowercased.
*
* This is always the case when used internally.
*
2010-06-27 17:28:29 +01:00
* @param array $parameters An array of parameters
*/
public function __construct(array $parameters = array())
{
$this->parameters = $parameters;
2010-06-27 17:28:29 +01:00
}
/**
2011-02-13 18:06:41 +00:00
* {@inheritDoc}
*/
2010-06-27 17:28:29 +01:00
public function clear()
{
throw new \LogicException('Impossible to call clear() on a frozen ParameterBag.');
}
/**
2011-02-13 18:06:41 +00:00
* {@inheritDoc}
2010-06-27 17:28:29 +01:00
*/
public function add(array $parameters)
{
throw new \LogicException('Impossible to call add() on a frozen ParameterBag.');
}
/**
2011-02-13 18:06:41 +00:00
* {@inheritDoc}
2010-06-27 17:28:29 +01:00
*/
public function set($name, $value)
{
throw new \LogicException('Impossible to call set() on a frozen ParameterBag.');
}
}