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

58 lines
1.4 KiB
PHP
Raw Normal View History

2010-06-27 17:28:29 +01:00
<?php
namespace Symfony\Component\DependencyInjection\ParameterBag;
2010-06-27 17:28:29 +01:00
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
/**
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
2010-06-27 17:28:29 +01:00
*/
class FrozenParameterBag extends ParameterBag
{
/**
* Constructor.
*
* @param array $parameters An array of parameters
*/
public function __construct(array $parameters = array())
{
foreach ($parameters as $key => $value) {
$this->parameters[strtolower($key)] = $value;
}
}
public function clear()
{
throw new \LogicException('Impossible to call clear() on a frozen ParameterBag.');
}
/**
* Adds parameters to the service container parameters.
*
* @param array $parameters An array of parameters
*/
public function add(array $parameters)
{
throw new \LogicException('Impossible to call add() on a frozen ParameterBag.');
}
/**
* Sets a service container parameter.
*
* @param string $name The parameter name
* @param mixed $parameters The parameter value
*/
public function set($name, $value)
{
throw new \LogicException('Impossible to call set() on a frozen ParameterBag.');
}
}