aboutsummaryrefslogtreecommitdiffstats
path: root/include/smarty/libs/sysplugins/smarty_internal_compile_continue.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2015-12-30 16:21:32 +0100
committerplegall <plg@piwigo.org>2015-12-30 16:21:32 +0100
commit3ec3cbe6cec5968d29cb11af139123191f4cb4ee (patch)
tree34aecd51071d63f8df1862a1a11898d8c43fe68a /include/smarty/libs/sysplugins/smarty_internal_compile_continue.php
parent6ba0148e646b2a193dc4111bb0a443d8c193e646 (diff)
parent1681b02ee98c2deb740d394280a2a685170bc72e (diff)
Merge branch 'bug/385-php7'
Diffstat (limited to 'include/smarty/libs/sysplugins/smarty_internal_compile_continue.php')
-rw-r--r--include/smarty/libs/sysplugins/smarty_internal_compile_continue.php39
1 files changed, 19 insertions, 20 deletions
diff --git a/include/smarty/libs/sysplugins/smarty_internal_compile_continue.php b/include/smarty/libs/sysplugins/smarty_internal_compile_continue.php
index 72a5f8653..2ee04c94e 100644
--- a/include/smarty/libs/sysplugins/smarty_internal_compile_continue.php
+++ b/include/smarty/libs/sysplugins/smarty_internal_compile_continue.php
@@ -1,22 +1,21 @@
<?php
/**
* Smarty Internal Plugin Compile Continue
- *
* Compiles the {continue} tag
*
- * @package Smarty
+ * @package Smarty
* @subpackage Compiler
- * @author Uwe Tews
+ * @author Uwe Tews
*/
/**
* Smarty Internal Plugin Compile Continue Class
*
- * @package Smarty
+ * @package Smarty
* @subpackage Compiler
*/
-class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {
-
+class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase
+{
/**
* Attribute definition: Overwrites base class.
*
@@ -24,6 +23,7 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {
* @see Smarty_Internal_CompileBase
*/
public $optional_attributes = array('levels');
+
/**
* Attribute definition: Overwrites base class.
*
@@ -35,24 +35,26 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {
/**
* Compiles code for the {continue} tag
*
- * @param array $args array with attributes from parser
- * @param object $compiler compiler object
- * @param array $parameter array with compilation parameter
+ * @param array $args array with attributes from parser
+ * @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
+ * @param array $parameter array with compilation parameter
+ *
* @return string compiled code
+ * @throws \SmartyCompilerException
*/
- public function compile($args, $compiler, $parameter)
+ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
{
static $_is_loopy = array('for' => true, 'foreach' => true, 'while' => true, 'section' => true);
// check and get attributes
$_attr = $this->getAttributes($compiler, $args);
if ($_attr['nocache'] === true) {
- $compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
+ $compiler->trigger_template_error('nocache option not allowed', null, true);
}
if (isset($_attr['levels'])) {
if (!is_numeric($_attr['levels'])) {
- $compiler->trigger_template_error('level attribute must be a numeric constant', $compiler->lex->taglineno);
+ $compiler->trigger_template_error('level attribute must be a numeric constant', null, true);
}
$_levels = $_attr['levels'];
} else {
@@ -62,17 +64,14 @@ class Smarty_Internal_Compile_Continue extends Smarty_Internal_CompileBase {
$stack_count = count($compiler->_tag_stack) - 1;
while ($level_count > 0 && $stack_count >= 0) {
if (isset($_is_loopy[$compiler->_tag_stack[$stack_count][0]])) {
- $level_count--;
+ $level_count --;
}
- $stack_count--;
+ $stack_count --;
}
if ($level_count != 0) {
- $compiler->trigger_template_error("cannot continue {$_levels} level(s)", $compiler->lex->taglineno);
+ $compiler->trigger_template_error("cannot continue {$_levels} level(s)", null, true);
}
- $compiler->has_code = true;
- return "<?php continue {$_levels}?>";
- }
+ return "<?php continue {$_levels};?>";
+ }
}
-
-?> \ No newline at end of file