1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-18 16:11:06 +02:00

[ticket/12715] Cleanup comments in \phpbb\template\*

PHPBB3-12715
This commit is contained in:
Tristan Darricau
2014-06-15 15:05:51 +02:00
parent e6b422517b
commit 0d0113e6da
19 changed files with 132 additions and 124 deletions

View File

@ -55,6 +55,7 @@ class context
* *
* @param string $varname Variable name * @param string $varname Variable name
* @param string $varval Value to assign to variable * @param string $varval Value to assign to variable
* @return true
*/ */
public function assign_var($varname, $varval) public function assign_var($varname, $varval)
{ {
@ -70,6 +71,7 @@ class context
* *
* @param string $varname Variable name * @param string $varname Variable name
* @param string $varval Value to append to variable * @param string $varval Value to append to variable
* @return true
*/ */
public function append_var($varname, $varval) public function append_var($varname, $varval)
{ {
@ -117,6 +119,7 @@ class context
* *
* @param string $blockname Name of block to assign $vararray to * @param string $blockname Name of block to assign $vararray to
* @param array $vararray A hash of variable name => value pairs * @param array $vararray A hash of variable name => value pairs
* @return true
*/ */
public function assign_block_vars($blockname, array $vararray) public function assign_block_vars($blockname, array $vararray)
{ {
@ -206,6 +209,7 @@ class context
* *
* @param string $blockname Name of block to assign $block_vars_array to * @param string $blockname Name of block to assign $block_vars_array to
* @param array $block_vars_array An array of hashes of variable name => value pairs * @param array $block_vars_array An array of hashes of variable name => value pairs
* @return true
*/ */
public function assign_block_vars_array($blockname, array $block_vars_array) public function assign_block_vars_array($blockname, array $block_vars_array)
{ {
@ -374,6 +378,7 @@ class context
* Reset/empty complete block * Reset/empty complete block
* *
* @param string $blockname Name of block to destroy * @param string $blockname Name of block to destroy
* @return true
*/ */
public function destroy_block_vars($blockname) public function destroy_block_vars($blockname)
{ {

View File

@ -175,6 +175,7 @@ interface template
/** /**
* Get path to template for handle (required for BBCode parser) * Get path to template for handle (required for BBCode parser)
* *
* @param string $handle Handle to retrieve the source file
* @return string * @return string
*/ */
public function get_source_file_for_handle($handle); public function get_source_file_for_handle($handle);

View File

@ -40,7 +40,7 @@ class environment extends \Twig_Environment
* @param \phpbb\path_helper * @param \phpbb\path_helper
* @param \phpbb\extension\manager * @param \phpbb\extension\manager
* @param string $phpbb_root_path * @param string $phpbb_root_path
* @param Twig_LoaderInterface $loader * @param \Twig_LoaderInterface $loader
* @param array $options Array of options to pass to Twig * @param array $options Array of options to pass to Twig
*/ */
public function __construct($phpbb_config, \phpbb\path_helper $path_helper, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array()) public function __construct($phpbb_config, \phpbb\path_helper $path_helper, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
@ -122,7 +122,7 @@ class environment extends \Twig_Environment
* Set the namespace look up order to load templates from * Set the namespace look up order to load templates from
* *
* @param array $namespace * @param array $namespace
* @return Twig_Environment * @return \Twig_Environment
*/ */
public function setNamespaceLookUpOrder($namespace) public function setNamespaceLookUpOrder($namespace)
{ {
@ -132,12 +132,13 @@ class environment extends \Twig_Environment
} }
/** /**
* Loads a template by name. * Loads a template by name.
* *
* @param string $name The template name * @param string $name The template name
* @param integer $index The index if it is an embedded template * @param integer $index The index if it is an embedded template
* @return Twig_TemplateInterface A template instance representing the given template name * @return \Twig_TemplateInterface A template instance representing the given template name
*/ * @throws \Twig_Error_Loader
*/
public function loadTemplate($name, $index = null) public function loadTemplate($name, $index = null)
{ {
if (strpos($name, '@') === false) if (strpos($name, '@') === false)
@ -168,11 +169,12 @@ class environment extends \Twig_Environment
} }
/** /**
* Finds a template by name. * Finds a template by name.
* *
* @param string $name The template name * @param string $name The template name
* @return string * @return string
*/ * @throws \Twig_Error_Loader
*/
public function findTemplate($name) public function findTemplate($name)
{ {
if (strpos($name, '@') === false) if (strpos($name, '@') === false)
@ -188,7 +190,7 @@ class environment extends \Twig_Environment
return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name); return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name);
} }
catch (Twig_Error_Loader $e) catch (\Twig_Error_Loader $e)
{ {
} }
} }

View File

@ -127,7 +127,7 @@ class extension extends \Twig_Extension
/** /**
* Grabs a subset of a loop * Grabs a subset of a loop
* *
* @param Twig_Environment $env A Twig_Environment instance * @param \Twig_Environment $env A Twig_Environment instance
* @param mixed $item A variable * @param mixed $item A variable
* @param integer $start Start of the subset * @param integer $start Start of the subset
* @param integer $end End of the subset * @param integer $end End of the subset

View File

@ -24,7 +24,7 @@ class loader extends \Twig_Loader_Filesystem
* Set safe directories * Set safe directories
* *
* @param array $directories Array of directories that are safe (empty to clear) * @param array $directories Array of directories that are safe (empty to clear)
* @return Twig_Loader_Filesystem * @return \Twig_Loader_Filesystem
*/ */
public function setSafeDirectories($directories = array()) public function setSafeDirectories($directories = array())
{ {
@ -45,7 +45,7 @@ class loader extends \Twig_Loader_Filesystem
* Add safe directory * Add safe directory
* *
* @param string $directory Directory that should be added * @param string $directory Directory that should be added
* @return Twig_Loader_Filesystem * @return \Twig_Loader_Filesystem
*/ */
public function addSafeDirectory($directory) public function addSafeDirectory($directory)
{ {
@ -110,7 +110,7 @@ class loader extends \Twig_Loader_Filesystem
// Try validating the name (which may throw an exception) // Try validating the name (which may throw an exception)
parent::validateName($name); parent::validateName($name);
} }
catch (Twig_Error_Loader $e) catch (\Twig_Error_Loader $e)
{ {
if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0) if (strpos($e->getRawMessage(), 'Looks like you try to load a template outside configured directories') === 0)
{ {

View File

@ -23,10 +23,10 @@ class definenode extends \Twig_Node
} }
/** /**
* Compiles the node to PHP. * Compiles the node to PHP.
* *
* @param Twig_Compiler A Twig_Compiler instance * @param \Twig_Compiler A Twig_Compiler instance
*/ */
public function compile(\Twig_Compiler $compiler) public function compile(\Twig_Compiler $compiler)
{ {
$compiler->addDebugInfo($this); $compiler->addDebugInfo($this);

View File

@ -17,12 +17,12 @@ namespace phpbb\template\twig\node;
class event extends \Twig_Node class event extends \Twig_Node
{ {
/** /**
* The subdirectory in which all template listener files must be placed * The subdirectory in which all template listener files must be placed
* @var string * @var string
*/ */
protected $listener_directory = 'event/'; protected $listener_directory = 'event/';
/** @var Twig_Environment */ /** @var \Twig_Environment */
protected $environment; protected $environment;
public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
@ -33,10 +33,10 @@ class event extends \Twig_Node
} }
/** /**
* Compiles the node to PHP. * Compiles the node to PHP.
* *
* @param Twig_Compiler A Twig_Compiler instance * @param \Twig_Compiler A Twig_Compiler instance
*/ */
public function compile(\Twig_Compiler $compiler) public function compile(\Twig_Compiler $compiler)
{ {
$compiler->addDebugInfo($this); $compiler->addDebugInfo($this);

View File

@ -15,7 +15,7 @@ namespace phpbb\template\twig\node;
abstract class includeasset extends \Twig_Node abstract class includeasset extends \Twig_Node
{ {
/** @var Twig_Environment */ /** @var \Twig_Environment */
protected $environment; protected $environment;
public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null) public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
@ -25,10 +25,10 @@ abstract class includeasset extends \Twig_Node
parent::__construct(array('expr' => $expr), array(), $lineno, $tag); parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
} }
/** /**
* Compiles the node to PHP. * Compiles the node to PHP.
* *
* @param Twig_Compiler A Twig_Compiler instance * @param \Twig_Compiler A Twig_Compiler instance
*/ */
public function compile(\Twig_Compiler $compiler) public function compile(\Twig_Compiler $compiler)
{ {
$compiler->addDebugInfo($this); $compiler->addDebugInfo($this);
@ -74,7 +74,7 @@ abstract class includeasset extends \Twig_Node
/** /**
* Append the output code for the asset * Append the output code for the asset
* *
* @param Twig_Compiler A Twig_Compiler instance * @param \Twig_Compiler A Twig_Compiler instance
* @return null * @return null
*/ */
abstract protected function append_asset(\Twig_Compiler $compiler); abstract protected function append_asset(\Twig_Compiler $compiler);

View File

@ -17,10 +17,10 @@ namespace phpbb\template\twig\node;
class includenode extends \Twig_Node_Include class includenode extends \Twig_Node_Include
{ {
/** /**
* Compiles the node to PHP. * Compiles the node to PHP.
* *
* @param Twig_Compiler A Twig_Compiler instance * @param \Twig_Compiler A Twig_Compiler instance
*/ */
public function compile(\Twig_Compiler $compiler) public function compile(\Twig_Compiler $compiler)
{ {
$compiler->addDebugInfo($this); $compiler->addDebugInfo($this);

View File

@ -17,7 +17,7 @@ namespace phpbb\template\twig\node;
class includephp extends \Twig_Node class includephp extends \Twig_Node
{ {
/** @var Twig_Environment */ /** @var \Twig_Environment */
protected $environment; protected $environment;
public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null) public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $ignoreMissing = false, $tag = null)
@ -28,10 +28,10 @@ class includephp extends \Twig_Node
} }
/** /**
* Compiles the node to PHP. * Compiles the node to PHP.
* *
* @param Twig_Compiler A Twig_Compiler instance * @param \Twig_Compiler A Twig_Compiler instance
*/ */
public function compile(\Twig_Compiler $compiler) public function compile(\Twig_Compiler $compiler)
{ {
$compiler->addDebugInfo($this); $compiler->addDebugInfo($this);

View File

@ -16,7 +16,7 @@ namespace phpbb\template\twig\node;
class php extends \Twig_Node class php extends \Twig_Node
{ {
/** @var Twig_Environment */ /** @var \Twig_Environment */
protected $environment; protected $environment;
public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null) public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
@ -27,10 +27,10 @@ class php extends \Twig_Node
} }
/** /**
* Compiles the node to PHP. * Compiles the node to PHP.
* *
* @param Twig_Compiler A Twig_Compiler instance * @param \Twig_Compiler A Twig_Compiler instance
*/ */
public function compile(\Twig_Compiler $compiler) public function compile(\Twig_Compiler $compiler)
{ {
$compiler->addDebugInfo($this); $compiler->addDebugInfo($this);

View File

@ -18,12 +18,14 @@ namespace phpbb\template\twig\tokenparser;
class defineparser extends \Twig_TokenParser class defineparser extends \Twig_TokenParser
{ {
/** /**
* Parses a token and returns a node. * Parses a token and returns a node.
* *
* @param Twig_Token $token A Twig_Token instance * @param \Twig_Token $token A Twig_Token instance
* *
* @return Twig_NodeInterface A Twig_NodeInterface instance * @return \Twig_NodeInterface A Twig_NodeInterface instance
*/ * @throws \Twig_Error_Syntax
* @throws \phpbb\template\twig\node\definenode
*/
public function parse(\Twig_Token $token) public function parse(\Twig_Token $token)
{ {
$lineno = $token->getLine(); $lineno = $token->getLine();
@ -61,10 +63,10 @@ class defineparser extends \Twig_TokenParser
} }
/** /**
* Gets the tag name associated with this token parser. * Gets the tag name associated with this token parser.
* *
* @return string The tag name * @return string The tag name
*/ */
public function getTag() public function getTag()
{ {
return 'DEFINE'; return 'DEFINE';

View File

@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser;
class event extends \Twig_TokenParser class event extends \Twig_TokenParser
{ {
/** /**
* Parses a token and returns a node. * Parses a token and returns a node.
* *
* @param Twig_Token $token A Twig_Token instance * @param \Twig_Token $token A Twig_Token instance
* *
* @return Twig_NodeInterface A Twig_NodeInterface instance * @return \Twig_NodeInterface A Twig_NodeInterface instance
*/ */
public function parse(\Twig_Token $token) public function parse(\Twig_Token $token)
{ {
$expr = $this->parser->getExpressionParser()->parseExpression(); $expr = $this->parser->getExpressionParser()->parseExpression();
@ -34,10 +34,10 @@ class event extends \Twig_TokenParser
} }
/** /**
* Gets the tag name associated with this token parser. * Gets the tag name associated with this token parser.
* *
* @return string The tag name * @return string The tag name
*/ */
public function getTag() public function getTag()
{ {
return 'EVENT'; return 'EVENT';

View File

@ -16,12 +16,12 @@ namespace phpbb\template\twig\tokenparser;
class includecss extends \Twig_TokenParser class includecss extends \Twig_TokenParser
{ {
/** /**
* Parses a token and returns a node. * Parses a token and returns a node.
* *
* @param Twig_Token $token A Twig_Token instance * @param \Twig_Token $token A Twig_Token instance
* *
* @return Twig_NodeInterface A Twig_NodeInterface instance * @return \Twig_NodeInterface A Twig_NodeInterface instance
*/ */
public function parse(\Twig_Token $token) public function parse(\Twig_Token $token)
{ {
$expr = $this->parser->getExpressionParser()->parseExpression(); $expr = $this->parser->getExpressionParser()->parseExpression();
@ -33,10 +33,10 @@ class includecss extends \Twig_TokenParser
} }
/** /**
* Gets the tag name associated with this token parser. * Gets the tag name associated with this token parser.
* *
* @return string The tag name * @return string The tag name
*/ */
public function getTag() public function getTag()
{ {
return 'INCLUDECSS'; return 'INCLUDECSS';

View File

@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser;
class includejs extends \Twig_TokenParser class includejs extends \Twig_TokenParser
{ {
/** /**
* Parses a token and returns a node. * Parses a token and returns a node.
* *
* @param Twig_Token $token A Twig_Token instance * @param \Twig_Token $token A Twig_Token instance
* *
* @return Twig_NodeInterface A Twig_NodeInterface instance * @return \Twig_NodeInterface A Twig_NodeInterface instance
*/ */
public function parse(\Twig_Token $token) public function parse(\Twig_Token $token)
{ {
$expr = $this->parser->getExpressionParser()->parseExpression(); $expr = $this->parser->getExpressionParser()->parseExpression();
@ -34,10 +34,10 @@ class includejs extends \Twig_TokenParser
} }
/** /**
* Gets the tag name associated with this token parser. * Gets the tag name associated with this token parser.
* *
* @return string The tag name * @return string The tag name
*/ */
public function getTag() public function getTag()
{ {
return 'INCLUDEJS'; return 'INCLUDEJS';

View File

@ -18,12 +18,12 @@ namespace phpbb\template\twig\tokenparser;
class includeparser extends \Twig_TokenParser_Include class includeparser extends \Twig_TokenParser_Include
{ {
/** /**
* Parses a token and returns a node. * Parses a token and returns a node.
* *
* @param Twig_Token $token A Twig_Token instance * @param \Twig_Token $token A Twig_Token instance
* *
* @return Twig_NodeInterface A Twig_NodeInterface instance * @return \Twig_NodeInterface A Twig_NodeInterface instance
*/ */
public function parse(\Twig_Token $token) public function parse(\Twig_Token $token)
{ {
$expr = $this->parser->getExpressionParser()->parseExpression(); $expr = $this->parser->getExpressionParser()->parseExpression();
@ -34,10 +34,10 @@ class includeparser extends \Twig_TokenParser_Include
} }
/** /**
* Gets the tag name associated with this token parser. * Gets the tag name associated with this token parser.
* *
* @return string The tag name * @return string The tag name
*/ */
public function getTag() public function getTag()
{ {
return 'INCLUDE'; return 'INCLUDE';

View File

@ -18,12 +18,12 @@ namespace phpbb\template\twig\tokenparser;
class includephp extends \Twig_TokenParser class includephp extends \Twig_TokenParser
{ {
/** /**
* Parses a token and returns a node. * Parses a token and returns a node.
* *
* @param Twig_Token $token A Twig_Token instance * @param \Twig_Token $token A Twig_Token instance
* *
* @return Twig_NodeInterface A Twig_NodeInterface instance * @return \Twig_NodeInterface A Twig_NodeInterface instance
*/ */
public function parse(\Twig_Token $token) public function parse(\Twig_Token $token)
{ {
$expr = $this->parser->getExpressionParser()->parseExpression(); $expr = $this->parser->getExpressionParser()->parseExpression();
@ -44,10 +44,10 @@ class includephp extends \Twig_TokenParser
} }
/** /**
* Gets the tag name associated with this token parser. * Gets the tag name associated with this token parser.
* *
* @return string The tag name * @return string The tag name
*/ */
public function getTag() public function getTag()
{ {
return 'INCLUDEPHP'; return 'INCLUDEPHP';

View File

@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser;
class php extends \Twig_TokenParser class php extends \Twig_TokenParser
{ {
/** /**
* Parses a token and returns a node. * Parses a token and returns a node.
* *
* @param Twig_Token $token A Twig_Token instance * @param \Twig_Token $token A Twig_Token instance
* *
* @return Twig_NodeInterface A Twig_NodeInterface instance * @return \Twig_NodeInterface A Twig_NodeInterface instance
*/ */
public function parse(\Twig_Token $token) public function parse(\Twig_Token $token)
{ {
$stream = $this->parser->getStream(); $stream = $this->parser->getStream();
@ -42,10 +42,10 @@ class php extends \Twig_TokenParser
} }
/** /**
* Gets the tag name associated with this token parser. * Gets the tag name associated with this token parser.
* *
* @return string The tag name * @return string The tag name
*/ */
public function getTag() public function getTag()
{ {
return 'PHP'; return 'PHP';

View File

@ -67,7 +67,7 @@ class twig extends \phpbb\template\base
/** /**
* Twig Environment * Twig Environment
* *
* @var Twig_Environment * @var \Twig_Environment
*/ */
protected $twig; protected $twig;
@ -347,9 +347,7 @@ class twig extends \phpbb\template\base
} }
/** /**
* Get path to template for handle (required for BBCode parser) * {@inheritdoc}
*
* @return string
*/ */
public function get_source_file_for_handle($handle) public function get_source_file_for_handle($handle)
{ {