summaryrefslogtreecommitdiff
path: root/lib/smarty3/sysplugins/smarty_internal_compilebase.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/smarty3/sysplugins/smarty_internal_compilebase.php')
-rw-r--r--lib/smarty3/sysplugins/smarty_internal_compilebase.php47
1 files changed, 27 insertions, 20 deletions
diff --git a/lib/smarty3/sysplugins/smarty_internal_compilebase.php b/lib/smarty3/sysplugins/smarty_internal_compilebase.php
index 08aab6f..2a32e43 100644
--- a/lib/smarty3/sysplugins/smarty_internal_compilebase.php
+++ b/lib/smarty3/sysplugins/smarty_internal_compilebase.php
@@ -45,15 +45,15 @@ abstract class Smarty_Internal_CompileBase
public $option_flags = array('nocache');
/**
- * Mapping array for boolqn option value
- *
+ * Mapping array for boolean option value
+ *
* @var array
*/
public $optionMap = array(1 => true, 0 => false, 'true' => true, 'false' => false);
/**
* Mapping array with attributes as key
- *
+ *
* @var array
*/
public $mapCache = array();
@@ -65,8 +65,8 @@ abstract class Smarty_Internal_CompileBase
* the corresponding list. The keyword '_any' specifies that any attribute will be accepted
* as valid
*
- * @param object $compiler compiler object
- * @param array $attributes attributes applied to the tag
+ * @param object $compiler compiler object
+ * @param array $attributes attributes applied to the tag
*
* @return array of mapped attributes for further processing
*/
@@ -103,8 +103,12 @@ abstract class Smarty_Internal_CompileBase
if (isset($this->optionMap[ $v ])) {
$_indexed_attr[ $k ] = $this->optionMap[ $v ];
} else {
- $compiler->trigger_template_error("illegal value '" . var_export($v, true) .
- "' for option flag '{$k}'", null, true);
+ $compiler->trigger_template_error(
+ "illegal value '" . var_export($v, true) .
+ "' for option flag '{$k}'",
+ null,
+ true
+ );
}
}
// must be named attribute
@@ -117,19 +121,25 @@ abstract class Smarty_Internal_CompileBase
// check if all required attributes present
foreach ($this->required_attributes as $attr) {
if (!isset($_indexed_attr[ $attr ])) {
- $compiler->trigger_template_error("missing \"" . $attr . "\" attribute", null, true);
+ $compiler->trigger_template_error("missing '{$attr}' attribute", null, true);
}
}
// check for not allowed attributes
- if ($this->optional_attributes != array('_any')) {
+ if ($this->optional_attributes !== array('_any')) {
if (!isset($this->mapCache[ 'all' ])) {
$this->mapCache[ 'all' ] =
- array_fill_keys(array_merge($this->required_attributes, $this->optional_attributes,
- $this->option_flags), true);
+ array_fill_keys(
+ array_merge(
+ $this->required_attributes,
+ $this->optional_attributes,
+ $this->option_flags
+ ),
+ true
+ );
}
foreach ($_indexed_attr as $key => $dummy) {
if (!isset($this->mapCache[ 'all' ][ $key ]) && $key !== 0) {
- $compiler->trigger_template_error("unexpected \"" . $key . "\" attribute", null, true);
+ $compiler->trigger_template_error("unexpected '{$key}' attribute", null, true);
}
}
}
@@ -162,8 +172,8 @@ abstract class Smarty_Internal_CompileBase
* Pop closing tag
* Raise an error if this stack-top doesn't match with expected opening tags
*
- * @param object $compiler compiler object
- * @param array|string $expectedTag the expected opening tag names
+ * @param object $compiler compiler object
+ * @param array|string $expectedTag the expected opening tag names
*
* @return mixed any type the opening tag's name or saved data
*/
@@ -173,7 +183,7 @@ abstract class Smarty_Internal_CompileBase
// get stacked info
list($_openTag, $_data) = array_pop($compiler->_tag_stack);
// open tag must match with the expected ones
- if (in_array($_openTag, (array) $expectedTag)) {
+ if (in_array($_openTag, (array)$expectedTag)) {
if (is_null($_data)) {
// return opening tag
return $_openTag;
@@ -183,14 +193,11 @@ abstract class Smarty_Internal_CompileBase
}
}
// wrong nesting of tags
- $compiler->trigger_template_error("unclosed {$compiler->smarty->left_delimiter}" . $_openTag .
- "{$compiler->smarty->right_delimiter} tag");
-
+ $compiler->trigger_template_error("unclosed '{$compiler->smarty->left_delimiter}{$_openTag}{$compiler->smarty->right_delimiter}' tag");
return;
}
// wrong nesting of tags
- $compiler->trigger_template_error("unexpected closing tag", null, true);
-
+ $compiler->trigger_template_error('unexpected closing tag', null, true);
return;
}
}