diff options
Diffstat (limited to 'phpBB/phpbb/template')
19 files changed, 132 insertions, 124 deletions
| diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php index 8df6c8b492..0a32879943 100644 --- a/phpBB/phpbb/template/context.php +++ b/phpBB/phpbb/template/context.php @@ -55,6 +55,7 @@ class context  	*  	* @param string $varname Variable name  	* @param string $varval Value to assign to variable +	* @return true  	*/  	public function assign_var($varname, $varval)  	{ @@ -70,6 +71,7 @@ class context  	*  	* @param string $varname Variable name  	* @param string $varval Value to append to variable +	* @return true  	*/  	public function append_var($varname, $varval)  	{ @@ -117,6 +119,7 @@ class context  	*  	* @param string $blockname Name of block to assign $vararray to  	* @param array $vararray A hash of variable name => value pairs +	* @return true  	*/  	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 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)  	{ @@ -374,6 +378,7 @@ class context  	* Reset/empty complete block  	*  	* @param string $blockname Name of block to destroy +	* @return true  	*/  	public function destroy_block_vars($blockname)  	{ diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php index 374f9e9359..041ecb12e4 100644 --- a/phpBB/phpbb/template/template.php +++ b/phpBB/phpbb/template/template.php @@ -175,6 +175,7 @@ interface template  	/**  	* Get path to template for handle (required for BBCode parser)  	* +	* @param string $handle Handle to retrieve the source file  	* @return string  	*/  	public function get_source_file_for_handle($handle); diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index d71c02967c..8d25153e14 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -40,7 +40,7 @@ class environment extends \Twig_Environment  	* @param \phpbb\path_helper  	* @param \phpbb\extension\manager  	* @param string $phpbb_root_path -	* @param Twig_LoaderInterface $loader +	* @param \Twig_LoaderInterface $loader  	* @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()) @@ -122,7 +122,7 @@ class environment extends \Twig_Environment  	* Set the namespace look up order to load templates from  	*  	* @param array $namespace -	* @return Twig_Environment +	* @return \Twig_Environment  	*/  	public function setNamespaceLookUpOrder($namespace)  	{ @@ -132,12 +132,13 @@ class environment extends \Twig_Environment  	}  	/** -	 * Loads a template by name. -	 * -	 * @param string  $name  The template name -	 * @param integer $index The index if it is an embedded template -	 * @return Twig_TemplateInterface A template instance representing the given template name -	 */ +	* Loads a template by name. +	* +	* @param string  $name  The template name +	* @param integer $index The index if it is an embedded template +	* @return \Twig_TemplateInterface A template instance representing the given template name +	* @throws \Twig_Error_Loader +	*/  	public function loadTemplate($name, $index = null)  	{  		if (strpos($name, '@') === false) @@ -168,11 +169,12 @@ class environment extends \Twig_Environment  	}  	/** -	 * Finds a template by name. -	 * -	 * @param string  $name  The template name -	 * @return string -	 */ +	* Finds a template by name. +	* +	* @param string  $name  The template name +	* @return string +	* @throws \Twig_Error_Loader +	*/  	public function findTemplate($name)  	{  		if (strpos($name, '@') === false) @@ -188,7 +190,7 @@ class environment extends \Twig_Environment  					return parent::getLoader()->getCacheKey('@' . $namespace . '/' . $name);  				} -				catch (Twig_Error_Loader $e) +				catch (\Twig_Error_Loader $e)  				{  				}  			} diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php index a357db30a5..8f523684dd 100644 --- a/phpBB/phpbb/template/twig/extension.php +++ b/phpBB/phpbb/template/twig/extension.php @@ -127,7 +127,7 @@ class extension extends \Twig_Extension  	/**  	* 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 integer          $start        Start of the subset  	* @param integer          $end   	     End of the subset diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php index 851eb9ddd0..2f8ffaa776 100644 --- a/phpBB/phpbb/template/twig/loader.php +++ b/phpBB/phpbb/template/twig/loader.php @@ -24,7 +24,7 @@ class loader extends \Twig_Loader_Filesystem  	* Set safe directories  	*  	* @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())  	{ @@ -45,7 +45,7 @@ class loader extends \Twig_Loader_Filesystem  	* Add safe directory  	*  	* @param string $directory Directory that should be added -	* @return Twig_Loader_Filesystem +	* @return \Twig_Loader_Filesystem  	*/  	public function addSafeDirectory($directory)  	{ @@ -110,7 +110,7 @@ class loader extends \Twig_Loader_Filesystem  			// Try validating the name (which may throw an exception)  			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)  			{ diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index fe336d4129..695ec4281f 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -23,10 +23,10 @@ class definenode extends \Twig_Node  	}  	/** -	 * Compiles the node to PHP. -	 * -	 * @param Twig_Compiler A Twig_Compiler instance -	 */ +	* Compiles the node to PHP. +	* +	* @param \Twig_Compiler A Twig_Compiler instance +	*/  	public function compile(\Twig_Compiler $compiler)  	{  		$compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index b551d7a75e..8fc4ba4775 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\node;  class event extends \Twig_Node  {  	/** -	 * The subdirectory in which all template listener files must be placed -	 * @var string -	 */ +	* The subdirectory in which all template listener files must be placed +	* @var string +	*/  	protected $listener_directory = 'event/'; -	/** @var Twig_Environment */ +	/** @var \Twig_Environment */  	protected $environment;  	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. -	 * -	 * @param Twig_Compiler A Twig_Compiler instance -	 */ +	* Compiles the node to PHP. +	* +	* @param \Twig_Compiler A Twig_Compiler instance +	*/  	public function compile(\Twig_Compiler $compiler)  	{  		$compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php index c41d4d03f3..15195a226b 100644 --- a/phpBB/phpbb/template/twig/node/includeasset.php +++ b/phpBB/phpbb/template/twig/node/includeasset.php @@ -15,7 +15,7 @@ namespace phpbb\template\twig\node;  abstract class includeasset extends \Twig_Node  { -	/** @var Twig_Environment */ +	/** @var \Twig_Environment */  	protected $environment;  	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);  	}  	/** -	 * Compiles the node to PHP. -	 * -	 * @param Twig_Compiler A Twig_Compiler instance -	 */ +	* Compiles the node to PHP. +	* +	* @param \Twig_Compiler A Twig_Compiler instance +	*/  	public function compile(\Twig_Compiler $compiler)  	{  		$compiler->addDebugInfo($this); @@ -74,7 +74,7 @@ abstract class includeasset extends \Twig_Node  	/**  	* Append the output code for the asset  	* -	* @param Twig_Compiler A Twig_Compiler instance +	* @param \Twig_Compiler A Twig_Compiler instance  	* @return null  	*/  	abstract protected function append_asset(\Twig_Compiler $compiler); diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php index 141c9ffe66..42428b6106 100644 --- a/phpBB/phpbb/template/twig/node/includenode.php +++ b/phpBB/phpbb/template/twig/node/includenode.php @@ -17,10 +17,10 @@ namespace phpbb\template\twig\node;  class includenode extends \Twig_Node_Include  {  	/** -	 * Compiles the node to PHP. -	 * -	 * @param Twig_Compiler A Twig_Compiler instance -	 */ +	* Compiles the node to PHP. +	* +	* @param \Twig_Compiler A Twig_Compiler instance +	*/  	public function compile(\Twig_Compiler $compiler)  	{  		$compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index e7df11c74e..826617e8e8 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -17,7 +17,7 @@ namespace phpbb\template\twig\node;  class includephp extends \Twig_Node  { -	/** @var Twig_Environment */ +	/** @var \Twig_Environment */  	protected $environment;  	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. -	 * -	 * @param Twig_Compiler A Twig_Compiler instance -	 */ +	* Compiles the node to PHP. +	* +	* @param \Twig_Compiler A Twig_Compiler instance +	*/  	public function compile(\Twig_Compiler $compiler)  	{  		$compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php index de3a8a4af1..3a24513dca 100644 --- a/phpBB/phpbb/template/twig/node/php.php +++ b/phpBB/phpbb/template/twig/node/php.php @@ -16,7 +16,7 @@ namespace phpbb\template\twig\node;  class php extends \Twig_Node  { -	/** @var Twig_Environment */ +	/** @var \Twig_Environment */  	protected $environment;  	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. -	 * -	 * @param Twig_Compiler A Twig_Compiler instance -	 */ +	* Compiles the node to PHP. +	* +	* @param \Twig_Compiler A Twig_Compiler instance +	*/  	public function compile(\Twig_Compiler $compiler)  	{  		$compiler->addDebugInfo($this); diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index 48c4853fe8..cfee84a363 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -18,12 +18,14 @@ namespace phpbb\template\twig\tokenparser;  class defineparser 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 -	 */ +	* Parses a token and returns a node. +	* +	* @param \Twig_Token $token A Twig_Token instance +	* +	* @return \Twig_NodeInterface A Twig_NodeInterface instance +	* @throws \Twig_Error_Syntax +	* @throws \phpbb\template\twig\node\definenode +	*/  	public function parse(\Twig_Token $token)  	{  		$lineno = $token->getLine(); @@ -61,10 +63,10 @@ class defineparser extends \Twig_TokenParser  	}  	/** -	 * Gets the tag name associated with this token parser. -	 * -	 * @return string The tag name -	 */ +	* Gets the tag name associated with this token parser. +	* +	* @return string The tag name +	*/  	public function getTag()  	{  		return 'DEFINE'; diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php index 05b963f3e8..4c7c8e07d9 100644 --- a/phpBB/phpbb/template/twig/tokenparser/event.php +++ b/phpBB/phpbb/template/twig/tokenparser/event.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser;  class event 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 -	 */ +	* 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(); @@ -34,10 +34,10 @@ class event extends \Twig_TokenParser  	}  	/** -	 * Gets the tag name associated with this token parser. -	 * -	 * @return string The tag name -	 */ +	* Gets the tag name associated with this token parser. +	* +	* @return string The tag name +	*/  	public function getTag()  	{  		return 'EVENT'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php index c7d2bb712e..1f30811754 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includecss.php +++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php @@ -16,12 +16,12 @@ namespace phpbb\template\twig\tokenparser;  class includecss 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 -	 */ +	* 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(); @@ -33,10 +33,10 @@ class includecss extends \Twig_TokenParser  	}  	/** -	 * Gets the tag name associated with this token parser. -	 * -	 * @return string The tag name -	 */ +	* Gets the tag name associated with this token parser. +	* +	* @return string The tag name +	*/  	public function getTag()  	{  		return 'INCLUDECSS'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php index 0c32692209..4156048e42 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includejs.php +++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser;  class includejs 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 -	 */ +	* 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(); @@ -34,10 +34,10 @@ class includejs extends \Twig_TokenParser  	}  	/** -	 * Gets the tag name associated with this token parser. -	 * -	 * @return string The tag name -	 */ +	* Gets the tag name associated with this token parser. +	* +	* @return string The tag name +	*/  	public function getTag()  	{  		return 'INCLUDEJS'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php index e9f4db0890..6ee78e5562 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -18,12 +18,12 @@ namespace phpbb\template\twig\tokenparser;  class includeparser extends \Twig_TokenParser_Include  {  	/** -	 * Parses a token and returns a node. -	 * -	 * @param Twig_Token $token A Twig_Token instance -	 * -	 * @return Twig_NodeInterface A Twig_NodeInterface instance -	 */ +	* 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(); @@ -34,10 +34,10 @@ class includeparser extends \Twig_TokenParser_Include  	}  	/** -	 * Gets the tag name associated with this token parser. -	 * -	 * @return string The tag name -	 */ +	* Gets the tag name associated with this token parser. +	* +	* @return string The tag name +	*/  	public function getTag()  	{  		return 'INCLUDE'; diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index f745c320c2..38196c5290 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -18,12 +18,12 @@ namespace phpbb\template\twig\tokenparser;  class includephp 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 -	 */ +	* 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(); @@ -44,10 +44,10 @@ class includephp extends \Twig_TokenParser  	}  	/** -	 * Gets the tag name associated with this token parser. -	 * -	 * @return string The tag name -	 */ +	* Gets the tag name associated with this token parser. +	* +	* @return string The tag name +	*/  	public function getTag()  	{  		return 'INCLUDEPHP'; diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index 0546a2d93f..557a70cca1 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -17,12 +17,12 @@ namespace phpbb\template\twig\tokenparser;  class php 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 -	 */ +	* 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)  	{  		$stream = $this->parser->getStream(); @@ -42,10 +42,10 @@ class php extends \Twig_TokenParser  	}  	/** -	 * Gets the tag name associated with this token parser. -	 * -	 * @return string The tag name -	 */ +	* Gets the tag name associated with this token parser. +	* +	* @return string The tag name +	*/  	public function getTag()  	{  		return 'PHP'; diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php index bf27dd5f20..5e2057f818 100644 --- a/phpBB/phpbb/template/twig/twig.php +++ b/phpBB/phpbb/template/twig/twig.php @@ -67,7 +67,7 @@ class twig extends \phpbb\template\base  	/**  	* Twig Environment  	* -	* @var Twig_Environment +	* @var \Twig_Environment  	*/  	protected $twig; @@ -347,9 +347,7 @@ class twig extends \phpbb\template\base  	}  	/** -	* Get path to template for handle (required for BBCode parser) -	* -	* @return string +	* {@inheritdoc}  	*/  	public function get_source_file_for_handle($handle)  	{ | 
