added some phpdoc for TokenParser classes
authorFabien Potencier <fabien.potencier@gmail.com>
Mon, 7 Jun 2010 17:28:03 +0000 (19:28 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Mon, 7 Jun 2010 17:28:41 +0000 (19:28 +0200)
16 files changed:
lib/Twig/TokenParser/AutoEscape.php
lib/Twig/TokenParser/Block.php
lib/Twig/TokenParser/Debug.php
lib/Twig/TokenParser/Display.php
lib/Twig/TokenParser/Extends.php
lib/Twig/TokenParser/Filter.php
lib/Twig/TokenParser/For.php
lib/Twig/TokenParser/If.php
lib/Twig/TokenParser/Import.php
lib/Twig/TokenParser/Include.php
lib/Twig/TokenParser/Macro.php
lib/Twig/TokenParser/Parent.php
lib/Twig/TokenParser/Sandbox.php
lib/Twig/TokenParser/Set.php
lib/Twig/TokenParser/Trans.php
lib/Twig/TokenParserInterface.php

index 01e1b88..08f047b 100644 (file)
  */
 class Twig_TokenParser_AutoEscape extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -39,6 +46,11 @@ class Twig_TokenParser_AutoEscape extends Twig_TokenParser
         return $token->test('endautoescape');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'autoescape';
index 2fa61e5..1d2f846 100644 (file)
  */
 class Twig_TokenParser_Block extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -53,6 +60,11 @@ class Twig_TokenParser_Block extends Twig_TokenParser
         return $token->test('endblock');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'block';
index 01fc6e2..aba2e9d 100644 (file)
  */
 class Twig_TokenParser_Debug extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -23,6 +30,11 @@ class Twig_TokenParser_Debug extends Twig_TokenParser
         return new Twig_Node_Debug($expr, $lineno, $this->getTag());
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'debug';
index 2d24eef..58e6ba6 100644 (file)
  */
 class Twig_TokenParser_Display extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -22,6 +29,11 @@ class Twig_TokenParser_Display extends Twig_TokenParser
         return new Twig_Node_BlockReference($name, $lineno, $this->getTag());
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'display';
index 3e04d1a..037d57a 100644 (file)
  */
 class Twig_TokenParser_Extends extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         if (null !== $this->parser->getParent()) {
@@ -22,6 +29,11 @@ class Twig_TokenParser_Extends extends Twig_TokenParser
         return null;
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'extends';
index 31c9387..4d053b7 100644 (file)
  */
 class Twig_TokenParser_Filter extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $filters = $this->parser->getExpressionParser()->parseFilterExpressionRaw();
@@ -36,6 +43,11 @@ class Twig_TokenParser_Filter extends Twig_TokenParser
         return $token->test('endfilter');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'filter';
index f18b72f..24afd6b 100644 (file)
  */
 class Twig_TokenParser_For extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -56,6 +63,11 @@ class Twig_TokenParser_For extends Twig_TokenParser
         return $token->test('endfor');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'for';
index 14a7429..d4f38b0 100644 (file)
  */
 class Twig_TokenParser_If extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -65,6 +72,11 @@ class Twig_TokenParser_If extends Twig_TokenParser
         return $token->test(array('endif'));
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'if';
index 1bc89ce..e791138 100644 (file)
  */
 class Twig_TokenParser_Import extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $macro = $this->parser->getExpressionParser()->parseExpression();
@@ -20,6 +27,11 @@ class Twig_TokenParser_Import extends Twig_TokenParser
         return new Twig_Node_Import($macro, $var, $token->getLine(), $this->getTag());
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'import';
index bb68eb6..cfdaab7 100644 (file)
  */
 class Twig_TokenParser_Include extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $expr = $this->parser->getExpressionParser()->parseExpression();
@@ -27,6 +34,11 @@ class Twig_TokenParser_Include extends Twig_TokenParser
         return new Twig_Node_Include($expr, $variables, $token->getLine(), $this->getTag());
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'include';
index 567ecfa..20186c6 100644 (file)
  */
 class Twig_TokenParser_Macro extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -31,6 +38,11 @@ class Twig_TokenParser_Macro extends Twig_TokenParser
         return $token->test('endmacro');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'macro';
index c157cef..7867cb4 100644 (file)
  */
 class Twig_TokenParser_Parent extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         if (!count($this->parser->getBlockStack())) {
@@ -21,6 +28,11 @@ class Twig_TokenParser_Parent extends Twig_TokenParser
         return new Twig_Node_Parent($this->parser->peekBlockStack(), $token->getLine(), $this->getTag());
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'parent';
index dbca198..a4b6f33 100644 (file)
  */
 class Twig_TokenParser_Sandbox extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
@@ -24,6 +31,11 @@ class Twig_TokenParser_Sandbox extends Twig_TokenParser
         return $token->test('endsandbox');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'sandbox';
index 72fb028..05a565d 100644 (file)
  */
 class Twig_TokenParser_Set extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -47,6 +54,11 @@ class Twig_TokenParser_Set extends Twig_TokenParser
         return $token->test('endset');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'set';
index 7aa49f4..806bf3d 100644 (file)
  */
 class Twig_TokenParser_Trans extends Twig_TokenParser
 {
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token)
     {
         $lineno = $token->getLine();
@@ -45,6 +52,11 @@ class Twig_TokenParser_Trans extends Twig_TokenParser
         return $token->test('endtrans');
     }
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag()
     {
         return 'trans';
index 77407e9..8bcc691 100644 (file)
@@ -12,7 +12,19 @@ interface Twig_TokenParserInterface
 {
     public function setParser(Twig_Parser $parser);
 
+    /**
+     * Parses a token and returns a node.
+     *
+     * @param Twig_Token $token A Twig_Token instance
+     *
+     * @return Twig_NodeInterface A Twig_NodeInterface instance
+     */
     public function parse(Twig_Token $token);
 
+    /**
+     * Gets the tag name associated with this token parser.
+     *
+     * @param string The tag name
+     */
     public function getTag();
 }