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/ParameterBagInterface.php

116 lines
2.4 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;
use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
2010-06-27 17:28:29 +01:00
/**
* ParameterBagInterface.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @api
2010-06-27 17:28:29 +01:00
*/
interface ParameterBagInterface
{
/**
* Clears all parameters.
*
* @api
2010-06-27 17:28:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function clear();
2010-06-27 17:28:29 +01:00
/**
* Adds parameters to the service container parameters.
*
* @param array $parameters An array of parameters
*
* @api
2010-06-27 17:28:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function add(array $parameters);
2010-06-27 17:28:29 +01:00
/**
* Gets the service container parameters.
*
* @return array An array of parameters
*
* @api
2010-06-27 17:28:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function all();
2010-06-27 17:28:29 +01:00
/**
* Gets a service container parameter.
*
* @param string $name The parameter name
*
* @return mixed The parameter value
*
* @throws ParameterNotFoundException if the parameter is not defined
*
* @api
2010-06-27 17:28:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function get($name);
2010-06-27 17:28:29 +01:00
/**
* Sets a service container parameter.
*
2011-04-23 16:05:44 +01:00
* @param string $name The parameter name
* @param mixed $value The parameter value
*
* @api
2010-06-27 17:28:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function set($name, $value);
2010-06-27 17:28:29 +01:00
/**
* Returns true if a parameter name is defined.
*
2012-05-15 21:19:31 +01:00
* @param string $name The parameter name
2010-06-27 17:28:29 +01:00
*
* @return Boolean true if the parameter name is defined, false otherwise
*
* @api
2010-06-27 17:28:29 +01:00
*/
2012-07-09 13:50:58 +01:00
public function has($name);
/**
* Replaces parameter placeholders (%name%) by their values for all parameters.
*/
2012-07-09 13:50:58 +01:00
public function resolve();
/**
* Replaces parameter placeholders (%name%) by their values.
*
2012-05-15 21:19:31 +01:00
* @param mixed $value A value
*
* @throws ParameterNotFoundException if a placeholder references a parameter that does not exist
*/
2012-07-09 13:50:58 +01:00
public function resolveValue($value);
/**
* Escape parameter placeholders %
*
* @param mixed $value
*
* @return mixed
*/
2012-07-09 13:50:58 +01:00
public function escapeValue($value);
/**
* Unescape parameter placeholders %
*
* @param mixed $value
*
* @return mixed
*/
2012-07-09 13:50:58 +01:00
public function unescapeValue($value);
2010-06-27 17:28:29 +01:00
}