[ticket/11667] Make functions abstract in includeasset

Also comment properly

PHPBB3-11667
This commit is contained in:
Nathaniel Guse 2013-07-12 13:32:40 -05:00
parent 1d55709e13
commit 41d8bfa974
3 changed files with 35 additions and 8 deletions

View file

@ -62,4 +62,19 @@ abstract class phpbb_template_twig_node_includeasset extends Twig_Node
->raw("\n');\n") ->raw("\n');\n")
; ;
} }
/**
* Get the definition name
*
* @return string (e.g. 'SCRIPTS')
*/
abstract public function get_definition_name();
/**
* Append the output code for the asset
*
* @param Twig_Compiler A Twig_Compiler instance
* @return null
*/
abstract protected function append_asset(Twig_Compiler $compiler);
} }

View file

@ -9,16 +9,22 @@
class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_includeasset class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_includeasset
{ {
/**
* Get the definition name
*
* @return string (e.g. 'SCRIPTS')
*/
public function get_definition_name() public function get_definition_name()
{ {
return 'STYLESHEETS'; return 'STYLESHEETS';
} }
/** /**
* Compiles the node to PHP. * Append the output code for the asset
* *
* @param Twig_Compiler A Twig_Compiler instance * @param Twig_Compiler A Twig_Compiler instance
*/ * @return null
*/
public function append_asset(Twig_Compiler $compiler) public function append_asset(Twig_Compiler $compiler)
{ {
$compiler $compiler

View file

@ -9,16 +9,22 @@
class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includeasset class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includeasset
{ {
/**
* Get the definition name
*
* @return string (e.g. 'SCRIPTS')
*/
public function get_definition_name() public function get_definition_name()
{ {
return 'SCRIPTS'; return 'SCRIPTS';
} }
/** /**
* Compiles the node to PHP. * Append the output code for the asset
* *
* @param Twig_Compiler A Twig_Compiler instance * @param Twig_Compiler A Twig_Compiler instance
*/ * @return null
*/
protected function append_asset(Twig_Compiler $compiler) protected function append_asset(Twig_Compiler $compiler)
{ {
$config = $this->environment->get_phpbb_config(); $config = $this->environment->get_phpbb_config();