ソースを参照

Merge remote branch 'stof/ParameterBagInterface'

* stof/ParameterBagInterface:
  [DependencyInjection] Removed the public keyword from interface
  [DependencyInjection] Added missing methods in the ParameterBagInterface
  [DependencyInjection] Fixed phpdoc
Fabien Potencier 14 年 前
コミット
09cccf60c7

+ 2 - 2
src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php

@@ -69,7 +69,7 @@ class ParameterBag implements ParameterBagInterface
      *
      * @return mixed  The parameter value
      *
-     * @throws  \InvalidArgumentException if the parameter is not defined
+     * @throws  NonExistentParameterException if the parameter is not defined
      */
     public function get($name)
     {
@@ -126,7 +126,7 @@ class ParameterBag implements ParameterBagInterface
      *
      * @param  mixed $value A value
      *
-     * @throws \InvalidArgumentException if a placeholder references a parameter that does not exist
+     * @throws NonExistentParameterException if a placeholder references a parameter that does not exist
      */
     public function resolveValue($value)
     {

+ 14 - 0
src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBagInterface.php

@@ -66,4 +66,18 @@ interface ParameterBagInterface
      * @return Boolean true if the parameter name is defined, false otherwise
      */
     function has($name);
+
+    /**
+     * Replaces parameter placeholders (%name%) by their values for all parameters.
+     */
+    function resolve();
+
+    /**
+     * Replaces parameter placeholders (%name%) by their values.
+     *
+     * @param  mixed $value A value
+     *
+     * @throws NonExistentParameterException if a placeholder references a parameter that does not exist
+     */
+    function resolveValue($value);
 }