Kaynağa Gözat

[Templating] Added some missing PHPDoc

Xavier Perez 14 yıl önce
ebeveyn
işleme
2f9b9f5521

+ 9 - 0
src/Symfony/Component/Templating/DelegatingEngine.php

@@ -103,6 +103,15 @@ class DelegatingEngine implements EngineInterface
         return false;
     }
 
+    /**
+     * Get an engine able to render the given template.
+     *
+     * @param string $name A template name
+     *
+     * @return EngineInterface The engine
+     *
+     * @throws \RuntimeException if no engine able to work with the template is found
+     */
     protected function getEngine($name)
     {
         foreach ($this->engines as $engine) {

+ 18 - 1
src/Symfony/Component/Templating/PhpEngine.php

@@ -221,6 +221,11 @@ class PhpEngine implements EngineInterface, \ArrayAccess
         }
     }
 
+    /**
+     * Sets the helpers.
+     *
+     * @params Helper[] $helpers An array of helper
+     */
     public function setHelpers(array $helpers)
     {
         $this->helpers = array();
@@ -286,7 +291,8 @@ class PhpEngine implements EngineInterface, \ArrayAccess
     /**
      * Escapes a string by using the current charset.
      *
-     * @param mixed $value A variable to escape
+     * @param mixed  $value   A variable to escape
+     * @param string $context The context name
      *
      * @return string The escaped value
      */
@@ -440,6 +446,17 @@ class PhpEngine implements EngineInterface, \ArrayAccess
         );
     }
 
+    /**
+     * Convert a string from one encoding to another.
+     *
+     * @param string $string The string to convert
+     * @param string $to     The input encoding
+     * @param string $from   The output encoding
+     *
+     * @return string The string with the new encoding
+     *
+     * @throws \RuntimeException if no suitable encoding function is found (iconv or mbstring)
+     */
     public function convertEncoding($string, $to, $from)
     {
         if (function_exists('iconv')) {