From dd9c076dfaef0be4059961e09b9ca1f706c0feff Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 26 Oct 2017 10:25:41 +0200 Subject: [PATCH] - correction of PHPDoc blocks - minor code cleanup --- change_log.txt | 2 + libs/Smarty.class.php | 33 ++++++- libs/SmartyBC.class.php | 23 ++++- libs/plugins/function.html_checkboxes.php | 16 +++- libs/plugins/function.html_options.php | 22 ++++- libs/plugins/function.html_radios.php | 16 +++- libs/plugins/function.html_table.php | 8 +- libs/plugins/modifier.capitalize.php | 23 ++++- libs/plugins/modifier.escape.php | 1 - libs/plugins/modifiercompiler.wordwrap.php | 6 +- libs/plugins/shared.mb_str_replace.php | 14 ++- .../smarty_cacheresource_custom.php | 3 +- .../smarty_cacheresource_keyvaluestore.php | 3 +- .../smarty_internal_cacheresource_file.php | 3 +- .../smarty_internal_compile_append.php | 1 + .../smarty_internal_compile_block.php | 15 ++- .../smarty_internal_compile_break.php | 8 +- .../smarty_internal_compile_continue.php | 9 +- .../smarty_internal_compile_extends.php | 6 ++ .../smarty_internal_compile_foreach.php | 25 +++-- .../smarty_internal_compile_function.php | 14 ++- .../sysplugins/smarty_internal_compile_if.php | 16 ++-- .../smarty_internal_compile_include.php | 15 +-- .../smarty_internal_compile_insert.php | 1 + .../smarty_internal_compile_make_nocache.php | 10 +- ..._internal_compile_private_block_plugin.php | 2 + ...nternal_compile_private_foreachsection.php | 4 + ...ternal_compile_private_function_plugin.php | 2 + ...arty_internal_compile_private_modifier.php | 2 + ...ternal_compile_private_object_function.php | 2 + .../smarty_internal_compile_private_php.php | 6 +- ...ernal_compile_private_print_expression.php | 1 + ...al_compile_private_registered_function.php | 2 + .../smarty_internal_compile_section.php | 1 + .../smarty_internal_config_file_compiler.php | 1 + .../smarty_internal_configfilelexer.php | 62 +++++++++++-- .../smarty_internal_configfileparser.php | 91 ++++++++++++++++++- libs/sysplugins/smarty_internal_data.php | 3 +- libs/sysplugins/smarty_internal_debug.php | 3 + .../smarty_internal_errorhandler.php | 2 +- ...rty_internal_method_addautoloadfilters.php | 2 +- .../smarty_internal_method_clearallcache.php | 3 +- .../smarty_internal_method_clearcache.php | 3 +- ..._internal_method_clearcompiledtemplate.php | 3 +- .../smarty_internal_method_configload.php | 5 +- ...rty_internal_method_getautoloadfilters.php | 4 +- .../smarty_internal_method_getglobal.php | 4 +- .../smarty_internal_method_gettags.php | 1 + .../smarty_internal_method_literals.php | 2 + ...rty_internal_method_setautoloadfilters.php | 1 + .../smarty_internal_method_unloadfilter.php | 3 +- ...marty_internal_method_unregisterfilter.php | 1 + libs/sysplugins/smarty_internal_parsetree.php | 4 +- .../smarty_internal_resource_extends.php | 3 + .../smarty_internal_resource_file.php | 2 + .../smarty_internal_resource_stream.php | 1 + .../smarty_internal_resource_string.php | 3 + .../smarty_internal_runtime_cachemodify.php | 3 + .../smarty_internal_runtime_codeframe.php | 2 +- ...smarty_internal_runtime_getincludepath.php | 2 +- .../smarty_internal_runtime_inheritance.php | 8 +- libs/sysplugins/smarty_internal_template.php | 10 +- .../smarty_internal_templatebase.php | 7 +- .../smarty_internal_templatecompilerbase.php | 11 ++- .../smarty_internal_templatelexer.php | 45 +++++++++ .../smarty_internal_templateparser.php | 91 +++++++++++++++++++ libs/sysplugins/smarty_resource.php | 7 +- .../sysplugins/smarty_resource_recompiled.php | 3 + libs/sysplugins/smarty_security.php | 4 +- libs/sysplugins/smarty_template_cached.php | 2 + libs/sysplugins/smarty_template_compiled.php | 3 +- .../smarty_template_resource_base.php | 6 +- libs/sysplugins/smarty_template_source.php | 12 ++- libs/sysplugins/smarty_undefined_variable.php | 10 +- libs/sysplugins/smartycompilerexception.php | 3 + libs/sysplugins/smartyexception.php | 3 + 76 files changed, 613 insertions(+), 141 deletions(-) diff --git a/change_log.txt b/change_log.txt index 812953e8a..22d629601 100644 --- a/change_log.txt +++ b/change_log.txt @@ -6,6 +6,8 @@ as Smarty does no longer use error suppression like @filemtime(). for backward compatibility code is moved from Smarty class to an external class and still can be called. + - correction of PHPDoc blocks + - minor code cleanup 21.10.2017 - bugfix custom delimiters could fail since modification of version 3.1.32-dev-23 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index bb7879a52..a0ad2d182 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -34,6 +34,9 @@ * Sets SMARTY_DIR only if user application has not already defined it. */ if (!defined('SMARTY_DIR')) { + /** + * + */ define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); } /** @@ -41,12 +44,21 @@ * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it. */ if (!defined('SMARTY_SYSPLUGINS_DIR')) { + /** + * + */ define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR); } if (!defined('SMARTY_PLUGINS_DIR')) { + /** + * + */ define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DIRECTORY_SEPARATOR); } if (!defined('SMARTY_MBSTRING')) { + /** + * + */ define('SMARTY_MBSTRING', function_exists('mb_get_info')); } if (!defined('SMARTY_RESOURCE_CHAR_SET')) { @@ -100,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.32-dev-30'; + const SMARTY_VERSION = '3.1.32-dev-31'; /** * define variable scopes */ @@ -620,7 +632,7 @@ public function __construct() /** * Enable error handler to mute expected messages * - * @return void + * @return boolean * @deprecated */ public static function muteExpectedErrors() @@ -643,7 +655,8 @@ public static function unmuteExpectedErrors() * * @param string $resource_name template name * - * @return boolean status + * @return bool status + * @throws \SmartyException */ public function templateExists($resource_name) { @@ -922,7 +935,8 @@ public function setCacheDir($cache_dir) * @param object $parent next higher level of Smarty variables * @param boolean $do_clone flag is Smarty object shall be cloned * - * @return object template object + * @return object template object + * @throws \SmartyException */ public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true) { @@ -1002,6 +1016,7 @@ public function loadPlugin($plugin_name, $check = true) * @param \Smarty_Internal_Template $template * * @return string + * @throws \SmartyException */ public function _getTemplateId($template_name, $cache_id = null, @@ -1259,6 +1274,16 @@ public function testInstall(&$errors = null) Smarty_Internal_TestInstall::testInstall($this, $errors); } + /** + * Get Smarty object + * + * @return Smarty + */ + public function _getSmartyObj() + { + return $this; + } + /** * <> Generic getter. * Calls the appropriate getter function. diff --git a/libs/SmartyBC.class.php b/libs/SmartyBC.class.php index 3955e4f24..f2230fc9c 100644 --- a/libs/SmartyBC.class.php +++ b/libs/SmartyBC.class.php @@ -100,6 +100,8 @@ public function clear_assign($tpl_var) * @param string $function_impl the name of the PHP function to register * @param bool $cacheable * @param mixed $cache_attrs + * + * @throws \SmartyException */ public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null) { @@ -153,6 +155,8 @@ public function unregister_object($object) * @param string $block_impl PHP function to register * @param bool $cacheable * @param mixed $cache_attrs + * + * @throws \SmartyException */ public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null) { @@ -175,6 +179,8 @@ public function unregister_block($block) * @param string $function name of template function * @param string $function_impl name of PHP function to register * @param bool $cacheable + * + * @throws \SmartyException */ public function register_compiler_function($function, $function_impl, $cacheable = true) { @@ -196,6 +202,8 @@ public function unregister_compiler_function($function) * * @param string $modifier name of template modifier * @param string $modifier_impl name of PHP function to register + * + * @throws \SmartyException */ public function register_modifier($modifier, $modifier_impl) { @@ -238,6 +246,8 @@ public function unregister_resource($type) * to a template before compiling * * @param callable $function + * + * @throws \SmartyException */ public function register_prefilter($function) { @@ -259,6 +269,8 @@ public function unregister_prefilter($function) * to a compiled template after compilation * * @param callable $function + * + * @throws \SmartyException */ public function register_postfilter($function) { @@ -280,6 +292,8 @@ public function unregister_postfilter($function) * to a template output * * @param callable $function + * + * @throws \SmartyException */ public function register_outputfilter($function) { @@ -301,6 +315,8 @@ public function unregister_outputfilter($function) * * @param string $type filter type * @param string $name filter name + * + * @throws \SmartyException */ public function load_filter($type, $name) { @@ -341,7 +357,9 @@ public function clear_all_cache($exp_time = null) * @param string $cache_id * @param string $compile_id * - * @return boolean + * @return bool + * @throws \Exception + * @throws \SmartyException */ public function is_cached($tpl_file, $cache_id = null, $compile_id = null) { @@ -377,7 +395,8 @@ public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_ti * * @param string $tpl_file * - * @return boolean + * @return bool + * @throws \SmartyException */ public function template_exists($tpl_file) { diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php index 84b8456d4..e7a3f725e 100644 --- a/libs/plugins/function.html_checkboxes.php +++ b/libs/plugins/function.html_checkboxes.php @@ -179,9 +179,21 @@ function smarty_function_html_checkboxes($params, $template) return implode("\n", $_html_result); } } - +/** + * @param $name + * @param $value + * @param $output + * @param $selected + * @param $extra + * @param $separator + * @param $labels + * @param $label_ids + * @param bool $escape + * + * @return string + */ function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels, - $label_ids, $escape = true) + $label_ids, $escape = true) { $_output = ''; diff --git a/libs/plugins/function.html_options.php b/libs/plugins/function.html_options.php index fd67d81bb..d0e794528 100644 --- a/libs/plugins/function.html_options.php +++ b/libs/plugins/function.html_options.php @@ -157,7 +157,16 @@ function smarty_function_html_options($params, Smarty_Internal_Template $templat return $_html_result; } - +/** + * @param $key + * @param $value + * @param $selected + * @param $id + * @param $class + * @param $idx + * + * @return string + */ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $class, &$idx) { if (!is_array($value)) { @@ -196,7 +205,16 @@ function smarty_function_html_options_optoutput($key, $value, $selected, $id, $c return $_html_result; } - +/** + * @param $key + * @param $values + * @param $selected + * @param $id + * @param $class + * @param $idx + * + * @return string + */ function smarty_function_html_options_optgroup($key, $values, $selected, $id, $class, &$idx) { $optgroup_html = '' . "\n"; diff --git a/libs/plugins/function.html_radios.php b/libs/plugins/function.html_radios.php index ac12ad71f..2d71b1c30 100644 --- a/libs/plugins/function.html_radios.php +++ b/libs/plugins/function.html_radios.php @@ -166,9 +166,21 @@ function smarty_function_html_radios($params, $template) return implode("\n", $_html_result); } } - +/** + * @param $name + * @param $value + * @param $output + * @param $selected + * @param $extra + * @param $separator + * @param $labels + * @param $label_ids + * @param $escape + * + * @return string + */ function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids, - $escape) + $escape) { $_output = ''; diff --git a/libs/plugins/function.html_table.php b/libs/plugins/function.html_table.php index 42e23e722..7efcdbd2b 100644 --- a/libs/plugins/function.html_table.php +++ b/libs/plugins/function.html_table.php @@ -163,7 +163,13 @@ function smarty_function_html_table($params) return $output; } - +/** + * @param $name + * @param $var + * @param $no + * + * @return string + */ function smarty_function_html_table_cycle($name, $var, $no) { if (!is_array($var)) { diff --git a/libs/plugins/modifier.capitalize.php b/libs/plugins/modifier.capitalize.php index 6513a0495..79c1a4fec 100644 --- a/libs/plugins/modifier.capitalize.php +++ b/libs/plugins/modifier.capitalize.php @@ -80,21 +80,38 @@ function smarty_modifier_capitalize($string, $uc_digits = false, $lc_rest = fals * * @author Kyle Renfrow */ +/** + * @param $matches + * + * @return string + */ function smarty_mod_cap_mbconvert_cb($matches) { return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 2 ]), MB_CASE_UPPER, Smarty::$_CHARSET); } - +/** + * @param $matches + * + * @return string + */ function smarty_mod_cap_mbconvert2_cb($matches) { return stripslashes($matches[ 1 ]) . mb_convert_case(stripslashes($matches[ 3 ]), MB_CASE_UPPER, Smarty::$_CHARSET); } - +/** + * @param $matches + * + * @return string + */ function smarty_mod_cap_ucfirst_cb($matches) { return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 2 ])); } - +/** + * @param $matches + * + * @return string + */ function smarty_mod_cap_ucfirst2_cb($matches) { return stripslashes($matches[ 1 ]) . ucfirst(stripslashes($matches[ 3 ])); diff --git a/libs/plugins/modifier.escape.php b/libs/plugins/modifier.escape.php index 0bb377056..2124e5072 100644 --- a/libs/plugins/modifier.escape.php +++ b/libs/plugins/modifier.escape.php @@ -26,7 +26,6 @@ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = null, $ { static $_double_encode = null; static $is_loaded1 = false; - static $is_loaded2 = false; if ($_double_encode === null) { $_double_encode = version_compare(PHP_VERSION, '5.2.3', '>='); } diff --git a/libs/plugins/modifiercompiler.wordwrap.php b/libs/plugins/modifiercompiler.wordwrap.php index f518d14a9..f5fb239c3 100644 --- a/libs/plugins/modifiercompiler.wordwrap.php +++ b/libs/plugins/modifiercompiler.wordwrap.php @@ -5,7 +5,6 @@ * @package Smarty * @subpackage PluginsModifierCompiler */ - /** * Smarty wordwrap modifier plugin * Type: modifier
@@ -15,10 +14,11 @@ * @link http://smarty.php.net/manual/en/language.modifier.wordwrap.php wordwrap (Smarty online manual) * @author Uwe Tews * - * @param array $params parameters - * @param $compiler + * @param array $params parameters + * @param \Smarty_Internal_TemplateCompilerBase $compiler * * @return string with compiled code + * @throws \SmartyException */ function smarty_modifiercompiler_wordwrap($params, Smarty_Internal_TemplateCompilerBase $compiler) { diff --git a/libs/plugins/shared.mb_str_replace.php b/libs/plugins/shared.mb_str_replace.php index 0c3ffe258..300702933 100644 --- a/libs/plugins/shared.mb_str_replace.php +++ b/libs/plugins/shared.mb_str_replace.php @@ -6,14 +6,13 @@ * @subpackage PluginsShared */ if (!function_exists('smarty_mb_str_replace')) { - /** * Multibyte string replace * - * @param string $search the string to be searched - * @param string $replace the replacement string - * @param string $subject the source string - * @param int &$count number of matches found + * @param string|string[] $search the string to be searched + * @param string|string[] $replace the replacement string + * @param string $subject the source string + * @param int &$count number of matches found * * @return string replaced string * @author Rodney Rehm @@ -29,7 +28,7 @@ function smarty_mb_str_replace($search, $replace, $subject, &$count = 0) $string = smarty_mb_str_replace($search, $replace, $string, $c); $count += $c; } - } elseif (is_array($search)) { + } else if (is_array($search)) { if (!is_array($replace)) { foreach ($search as &$string) { $subject = smarty_mb_str_replace($string, $replace, $subject, $c); @@ -37,7 +36,7 @@ function smarty_mb_str_replace($search, $replace, $subject, &$count = 0) } } else { $n = max(count($search), count($replace)); - while ($n --) { + while ($n--) { $subject = smarty_mb_str_replace(current($search), current($replace), $subject, $c); $count += $c; next($search); @@ -49,7 +48,6 @@ function smarty_mb_str_replace($search, $replace, $subject, &$count = 0) $count = count($parts) - 1; $subject = implode($replace, $parts); } - return $subject; } } diff --git a/libs/sysplugins/smarty_cacheresource_custom.php b/libs/sysplugins/smarty_cacheresource_custom.php index 8f1290e49..b3f4c1b2e 100644 --- a/libs/sysplugins/smarty_cacheresource_custom.php +++ b/libs/sysplugins/smarty_cacheresource_custom.php @@ -204,7 +204,8 @@ public function clearAll(Smarty $smarty, $exp_time = null) * @param string $compile_id compile id * @param integer $exp_time expiration time (number of seconds, not timestamp) * - * @return integer number of cache files deleted + * @return int number of cache files deleted + * @throws \SmartyException */ public function clear(Smarty $smarty, $resource_name, $cache_id, $compile_id, $exp_time) { diff --git a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php index bab1b5c09..47e010a7e 100644 --- a/libs/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/libs/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -180,7 +180,8 @@ public function clearAll(Smarty $smarty, $exp_time = null) * @param string $compile_id compile id * @param integer $exp_time expiration time [being ignored] * - * @return integer number of cache files deleted [always -1] + * @return int number of cache files deleted [always -1] + * @throws \SmartyException * @uses buildCachedFilepath() to generate the CacheID * @uses invalidate() to mark CacheIDs parent chain as outdated * @uses delete() to remove CacheID from cache diff --git a/libs/sysplugins/smarty_internal_cacheresource_file.php b/libs/sysplugins/smarty_internal_cacheresource_file.php index 372e8cf4f..942c003c2 100644 --- a/libs/sysplugins/smarty_internal_cacheresource_file.php +++ b/libs/sysplugins/smarty_internal_cacheresource_file.php @@ -106,7 +106,8 @@ public function process(Smarty_Internal_Template $_smarty_tpl, * @param Smarty_Internal_Template $_template template object * @param string $content content to cache * - * @return boolean success + * @return bool success + * @throws \SmartyException */ public function writeCachedContent(Smarty_Internal_Template $_template, $content) { diff --git a/libs/sysplugins/smarty_internal_compile_append.php b/libs/sysplugins/smarty_internal_compile_append.php index 8539d6b2a..b3689e918 100644 --- a/libs/sysplugins/smarty_internal_compile_append.php +++ b/libs/sysplugins/smarty_internal_compile_append.php @@ -24,6 +24,7 @@ class Smarty_Internal_Compile_Append extends Smarty_Internal_Compile_Assign * @param array $parameter array with compilation parameter * * @return string compiled code + * @throws \SmartyCompilerException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { diff --git a/libs/sysplugins/smarty_internal_compile_block.php b/libs/sysplugins/smarty_internal_compile_block.php index 7a245e761..e32390315 100644 --- a/libs/sysplugins/smarty_internal_compile_block.php +++ b/libs/sysplugins/smarty_internal_compile_block.php @@ -57,13 +57,12 @@ class Smarty_Internal_Compile_Block extends Smarty_Internal_Compile_Shared_Inher /** * Compiles code for the {block} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { if (!isset($compiler->_cache['blockNesting'])) { $compiler->_cache['blockNesting'] = 0; @@ -151,13 +150,13 @@ class Smarty_Internal_Compile_Blockclose extends Smarty_Internal_Compile_Shared_ /** * Compiles code for the {/block} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code + * @internal param array $parameter array with compilation parameter */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { list($_attr, $_nocache, $_buffer, $_has_nocache_code, $_caching) = $this->closeTag($compiler, array('block')); // init block parameter diff --git a/libs/sysplugins/smarty_internal_compile_break.php b/libs/sysplugins/smarty_internal_compile_break.php index 50157382a..ce162cb57 100644 --- a/libs/sysplugins/smarty_internal_compile_break.php +++ b/libs/sysplugins/smarty_internal_compile_break.php @@ -35,13 +35,13 @@ class Smarty_Internal_Compile_Break extends Smarty_Internal_CompileBase /** * Compiles code for the {break} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code + * @throws \SmartyCompilerException */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { list($levels, $foreachLevels) = $this->checkLevels($args, $compiler); $output = "checkLevels($args, $compiler, 'continue'); $output = "loopNesting ++; // init @@ -277,13 +277,12 @@ class Smarty_Internal_Compile_Foreachelse extends Smarty_Internal_CompileBase /** * Compiles code for the {foreachelse} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { // check and get attributes $_attr = $this->getAttributes($compiler, $args); @@ -310,13 +309,13 @@ class Smarty_Internal_Compile_Foreachclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/foreach} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + * @throws \SmartyCompilerException + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { $compiler->loopNesting --; // must endblock be nocache? diff --git a/libs/sysplugins/smarty_internal_compile_function.php b/libs/sysplugins/smarty_internal_compile_function.php index b7cd9e1c0..3badf8ce7 100644 --- a/libs/sysplugins/smarty_internal_compile_function.php +++ b/libs/sysplugins/smarty_internal_compile_function.php @@ -44,14 +44,13 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase /** * Compiles code for the {function} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return bool true * @throws \SmartyCompilerException */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { // check and get attributes $_attr = $this->getAttributes($compiler, $args); @@ -91,13 +90,12 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/function} tag * - * @param array $args array with attributes from parser - * @param object|\Smarty_Internal_TemplateCompilerBase $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param object|\Smarty_Internal_TemplateCompilerBase $compiler compiler object * * @return bool true */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { $this->compiler = $compiler; $saved_data = $this->closeTag($compiler, array('function')); diff --git a/libs/sysplugins/smarty_internal_compile_if.php b/libs/sysplugins/smarty_internal_compile_if.php index 14db55d4f..bf4e04e3e 100644 --- a/libs/sysplugins/smarty_internal_compile_if.php +++ b/libs/sysplugins/smarty_internal_compile_if.php @@ -80,13 +80,12 @@ class Smarty_Internal_Compile_Else extends Smarty_Internal_CompileBase /** * Compiles code for the {else} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { list($nesting, $compiler->tag_nocache) = $this->closeTag($compiler, array('if', 'elseif')); $this->openTag($compiler, 'else', array($nesting, $compiler->tag_nocache)); @@ -188,13 +187,12 @@ class Smarty_Internal_Compile_Ifclose extends Smarty_Internal_CompileBase /** * Compiles code for the {/if} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { // must endblock be nocache? if ($compiler->nocache) { diff --git a/libs/sysplugins/smarty_internal_compile_include.php b/libs/sysplugins/smarty_internal_compile_include.php index 5fbbdac82..02b09f7af 100644 --- a/libs/sysplugins/smarty_internal_compile_include.php +++ b/libs/sysplugins/smarty_internal_compile_include.php @@ -59,14 +59,15 @@ class Smarty_Internal_Compile_Include extends Smarty_Internal_CompileBase /** * Compiles code for the {include} tag * - * @param array $args array with attributes from parser - * @param Smarty_Internal_SmartyTemplateCompiler $compiler compiler object - * @param array $parameter array with compilation parameter + * @param array $args array with attributes from parser + * @param Smarty_Internal_SmartyTemplateCompiler $compiler compiler object * - * @throws SmartyCompilerException - * @return string compiled code + * @return string + * @throws \Exception + * @throws \SmartyCompilerException + * @throws \SmartyException */ - public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler, $parameter) + public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler) { $uid = $t_hash = null; // check and get attributes @@ -271,6 +272,8 @@ public function compile($args, Smarty_Internal_SmartyTemplateCompiler $compiler, * @param string $t_hash * * @return bool + * @throws \Exception + * @throws \SmartyException */ public function compileInlineTemplate(Smarty_Internal_SmartyTemplateCompiler $compiler, Smarty_Internal_Template $tpl, diff --git a/libs/sysplugins/smarty_internal_compile_insert.php b/libs/sysplugins/smarty_internal_compile_insert.php index 117ec4ef3..bcab8a811 100644 --- a/libs/sysplugins/smarty_internal_compile_insert.php +++ b/libs/sysplugins/smarty_internal_compile_insert.php @@ -46,6 +46,7 @@ class Smarty_Internal_Compile_Insert extends Smarty_Internal_CompileBase * * @return string compiled code * @throws \SmartyCompilerException + * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { diff --git a/libs/sysplugins/smarty_internal_compile_make_nocache.php b/libs/sysplugins/smarty_internal_compile_make_nocache.php index fd8162393..84225b5df 100644 --- a/libs/sysplugins/smarty_internal_compile_make_nocache.php +++ b/libs/sysplugins/smarty_internal_compile_make_nocache.php @@ -41,14 +41,12 @@ class Smarty_Internal_Compile_Make_Nocache extends Smarty_Internal_CompileBase /** * Compiles code for the {make_nocache} tag * - * @param array $args array with attributes from parser - * @param \Smarty_Internal_TemplateCompilerBase $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 * * @return string compiled code - * @throws \SmartyCompilerException - */ - public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) + */ + public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { // check and get attributes $_attr = $this->getAttributes($compiler, $args); diff --git a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php index 617564276..49837e66d 100644 --- a/libs/sysplugins/smarty_internal_compile_private_block_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_block_plugin.php @@ -41,6 +41,8 @@ class Smarty_Internal_Compile_Private_Block_Plugin extends Smarty_Internal_Compi * @param string $function PHP function name * * @return string compiled code + * @throws \SmartyCompilerException + * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function = null) { diff --git a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php index bf569be3a..2fcd85783 100644 --- a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php +++ b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php @@ -76,6 +76,8 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com * * @param array $attributes * @param \Smarty_Internal_TemplateCompilerBase $compiler + * + * @throws \SmartyException */ public function scanForProperties($attributes, Smarty_Internal_TemplateCompilerBase $compiler) { @@ -161,6 +163,8 @@ public function matchTemplateSource(Smarty_Internal_TemplateCompilerBase $compil * Find matches in all parent template source * * @param \Smarty_Internal_TemplateCompilerBase $compiler + * + * @throws \SmartyException */ public function matchParentTemplateSource(Smarty_Internal_TemplateCompilerBase $compiler) { diff --git a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php index 26529bb68..7ecf61d2f 100644 --- a/libs/sysplugins/smarty_internal_compile_private_function_plugin.php +++ b/libs/sysplugins/smarty_internal_compile_private_function_plugin.php @@ -42,6 +42,8 @@ class Smarty_Internal_Compile_Private_Function_Plugin extends Smarty_Internal_Co * @param string $function PHP function name * * @return string compiled code + * @throws \SmartyCompilerException + * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $function) { diff --git a/libs/sysplugins/smarty_internal_compile_private_modifier.php b/libs/sysplugins/smarty_internal_compile_private_modifier.php index 5f8130b93..3a39c2baa 100644 --- a/libs/sysplugins/smarty_internal_compile_private_modifier.php +++ b/libs/sysplugins/smarty_internal_compile_private_modifier.php @@ -26,6 +26,7 @@ class Smarty_Internal_Compile_Private_Modifier extends Smarty_Internal_CompileBa * * @return string compiled code * @throws \SmartyCompilerException + * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { @@ -34,6 +35,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $ $output = $parameter[ 'value' ]; // loop over list of modifiers foreach ($parameter[ 'modifierlist' ] as $single_modifier) { + /* @var string $modifier */ $modifier = $single_modifier[ 0 ]; $single_modifier[ 0 ] = $output; $params = implode(',', $single_modifier); diff --git a/libs/sysplugins/smarty_internal_compile_private_object_function.php b/libs/sysplugins/smarty_internal_compile_private_object_function.php index 7f78a421e..4ef108fb4 100644 --- a/libs/sysplugins/smarty_internal_compile_private_object_function.php +++ b/libs/sysplugins/smarty_internal_compile_private_object_function.php @@ -34,6 +34,8 @@ class Smarty_Internal_Compile_Private_Object_Function extends Smarty_Internal_Co * @param string $method name of method to call * * @return string compiled code + * @throws \SmartyCompilerException + * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag, $method) { diff --git a/libs/sysplugins/smarty_internal_compile_private_php.php b/libs/sysplugins/smarty_internal_compile_private_php.php index 8bff8499f..9080c4879 100644 --- a/libs/sysplugins/smarty_internal_compile_private_php.php +++ b/libs/sysplugins/smarty_internal_compile_private_php.php @@ -107,9 +107,11 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $ * * This code has been moved from lexer here fo easier debugging and maintenance * - * @param $lex + * @param Smarty_Internal_Templatelexer $lex + * + * @throws \SmartyCompilerException */ - public function parsePhp($lex) + public function parsePhp(Smarty_Internal_Templatelexer $lex) { $lex->token = Smarty_Internal_Templateparser::TP_PHP; $close = 0; diff --git a/libs/sysplugins/smarty_internal_compile_private_print_expression.php b/libs/sysplugins/smarty_internal_compile_private_print_expression.php index 811996bcc..55d70915f 100644 --- a/libs/sysplugins/smarty_internal_compile_private_print_expression.php +++ b/libs/sysplugins/smarty_internal_compile_private_print_expression.php @@ -134,6 +134,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $ * @param string $output embedded output * * @return string + * @throws \SmartyException */ private function compile_output_filter(Smarty_Internal_TemplateCompilerBase $compiler, $name, $output) { diff --git a/libs/sysplugins/smarty_internal_compile_private_registered_function.php b/libs/sysplugins/smarty_internal_compile_private_registered_function.php index 3754f2b0f..48c719e0a 100644 --- a/libs/sysplugins/smarty_internal_compile_private_registered_function.php +++ b/libs/sysplugins/smarty_internal_compile_private_registered_function.php @@ -33,6 +33,8 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna * @param string $tag name of function * * @return string compiled code + * @throws \SmartyCompilerException + * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter, $tag) { diff --git a/libs/sysplugins/smarty_internal_compile_section.php b/libs/sysplugins/smarty_internal_compile_section.php index c3701fc63..c530cc766 100644 --- a/libs/sysplugins/smarty_internal_compile_section.php +++ b/libs/sysplugins/smarty_internal_compile_section.php @@ -84,6 +84,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo * * @return string compiled code * @throws \SmartyCompilerException + * @throws \SmartyException */ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler) { diff --git a/libs/sysplugins/smarty_internal_config_file_compiler.php b/libs/sysplugins/smarty_internal_config_file_compiler.php index ec1cb2be5..6b5d1e75c 100644 --- a/libs/sysplugins/smarty_internal_config_file_compiler.php +++ b/libs/sysplugins/smarty_internal_config_file_compiler.php @@ -97,6 +97,7 @@ public function __construct($lexer_class, $parser_class, Smarty $smarty) * @param Smarty_Internal_Template $template * * @return bool true if compiling succeeded, false if it failed + * @throws \SmartyException */ public function compileTemplate(Smarty_Internal_Template $template) { diff --git a/libs/sysplugins/smarty_internal_configfilelexer.php b/libs/sysplugins/smarty_internal_configfilelexer.php index d22b5146b..374d4492d 100644 --- a/libs/sysplugins/smarty_internal_configfilelexer.php +++ b/libs/sysplugins/smarty_internal_configfilelexer.php @@ -153,6 +153,9 @@ public function PrintTrace() $this->yyTracePrompt = '
'; } // end function + /** + * @param $state + */ public function yybegin($state) { $this->_yy_state = $state; @@ -165,7 +168,11 @@ public function yybegin($state) } } -public function yylex1() + /** + * @return bool + * @throws \Exception + */ + public function yylex1() { if (!isset($this->yy_global_pattern1)) { $this->yy_global_pattern1 = @@ -221,11 +228,19 @@ public function yylex1() } + /** + * @param $input + * + * @return mixed + */ public function replace($input) { return $input; } + /** + * @return mixed + */ public function yylex() { return $this->{'yylex' . $this->_yy_state}(); @@ -238,6 +253,9 @@ function yy_r1_1() $this->yypushstate(self::COMMENT); } + /** + * @param $state + */ public function yypushstate($state) { if ($this->yyTraceFILE) { @@ -278,6 +296,9 @@ function yy_r1_4() $this->yypushstate(self::VALUE); } + /** + * @return bool + */ function yy_r1_5() { @@ -302,7 +323,11 @@ function yy_r1_8() $this->token = Smarty_Internal_Configfileparser::TPC_OTHER; } -public function yylex2() + /** + * @return bool + * @throws \Exception + */ + public function yylex2() { if (!isset($this->yy_global_pattern2)) { $this->yy_global_pattern2 = @@ -358,6 +383,9 @@ public function yylex2() } + /** + * @return bool + */ function yy_r2_1() { @@ -419,6 +447,9 @@ function yy_r2_6() $this->yypopstate(); } // end function + /** + * @return bool + */ function yy_r2_7() { @@ -448,7 +479,11 @@ function yy_r2_9() $this->yypopstate(); } // end function -public function yylex3() + /** + * @return bool + * @throws \Exception + */ + public function yylex3() { if (!isset($this->yy_global_pattern3)) { $this->yy_global_pattern3 = $this->replace("/\G([^\n]+?(?=[ \t\r]*\n))/isS"); @@ -510,7 +545,11 @@ function yy_r3_1() $this->yypopstate(); } -public function yylex4() + /** + * @return bool + * @throws \Exception + */ + public function yylex4() { if (!isset($this->yy_global_pattern4)) { $this->yy_global_pattern4 = $this->replace("/\G([ \t\r]+)|\G([^\n]+?(?=[ \t\r]*\n))|\G(\n)/isS"); @@ -565,6 +604,9 @@ public function yylex4() } + /** + * @return bool + */ function yy_r4_1() { @@ -584,7 +626,11 @@ function yy_r4_3() $this->yypopstate(); } -public function yylex5() + /** + * @return bool + * @throws \Exception + */ + public function yylex5() { if (!isset($this->yy_global_pattern5)) { $this->yy_global_pattern5 = $this->replace("/\G(\\.)|\G(.*?(?=[\.=[\]\r\n]))/isS"); @@ -652,7 +698,11 @@ function yy_r5_2() $this->yypopstate(); } // end function -public function yylex6() + /** + * @return bool + * @throws \Exception + */ + public function yylex6() { if (!isset($this->yy_global_pattern6)) { $this->yy_global_pattern6 = $this->replace("/\G(\"\"\"(?=[ \t\r]*[\n#;]))|\G([\S\s])/isS"); diff --git a/libs/sysplugins/smarty_internal_configfileparser.php b/libs/sysplugins/smarty_internal_configfileparser.php index 4ffc854a5..aa0d6d4bd 100644 --- a/libs/sysplugins/smarty_internal_configfileparser.php +++ b/libs/sysplugins/smarty_internal_configfileparser.php @@ -1,10 +1,19 @@ string; } + /** + * @param mixed $offset + * + * @return bool + */ public function offsetExists($offset) { return isset($this->metadata[ $offset ]); } + /** + * @param mixed $offset + * + * @return mixed + */ public function offsetGet($offset) { return $this->metadata[ $offset ]; } + /** + * @param mixed $offset + * @param mixed $value + */ public function offsetSet($offset, $value) { if ($offset === null) { @@ -58,12 +84,18 @@ public function offsetSet($offset, $value) } } + /** + * @param mixed $offset + */ public function offsetUnset($offset) { unset($this->metadata[ $offset ]); } } +/** + * Class TPC_yyStackEntry + */ class TPC_yyStackEntry { public $stateno; /* The state-number */ @@ -247,6 +279,10 @@ function __construct(Smarty_Internal_Configfilelexer $lex, Smarty_Internal_Confi $this->configReadHidden = $this->smarty->config_read_hidden; } + /** + * @param $TraceFILE + * @param $zTracePrompt + */ public function Trace($TraceFILE, $zTracePrompt) { if (!$TraceFILE) { @@ -263,7 +299,11 @@ public function PrintTrace() $this->yyTraceFILE = fopen('php://output', 'w'); $this->yyTracePrompt = '
'; } /* Index of top element in stack */ - + /** + * @param $tokenType + * + * @return mixed|string + */ public function tokenName($tokenType) { if ($tokenType === 0) { @@ -303,6 +343,10 @@ public function yy_pop_parser_stack() return $yymajor; } + /** + * @param $yymajor + * @param $yypminor + */ public static function yy_destructor($yymajor, $yypminor) { switch ($yymajor) { @@ -311,6 +355,11 @@ public static function yy_destructor($yymajor, $yypminor) } } + /** + * @param $token + * + * @return array|mixed + */ public function yy_get_expected_tokens($token) { static $res3 = array(); @@ -395,6 +444,11 @@ public function yy_get_expected_tokens($token) return array_unique($expected); } + /** + * @param $iLookAhead + * + * @return int|mixed + */ public function yy_find_shift_action($iLookAhead) { $stateno = $this->yystack[ $this->yyidx ]->stateno; @@ -430,6 +484,12 @@ public function yy_find_shift_action($iLookAhead) } } + /** + * @param $stateno + * @param $iLookAhead + * + * @return int|mixed + */ public function yy_find_reduce_action($stateno, $iLookAhead) { /* $stateno = $this->yystack[$this->yyidx]->stateno; */ @@ -692,6 +752,12 @@ function yy_r17() #line 324 "../smarty/lexer/smarty_internal_configfileparser.y" + /** + * @param $yymajor + * @param $yytokenvalue + * + * @throws \SmartyCompilerException + */ public function doParse($yymajor, $yytokenvalue) { $yyerrorhit = 0; /* True if yymajor has invoked an error */ @@ -784,6 +850,11 @@ public function doParse($yymajor, $yytokenvalue) } while ($yymajor != self::YYNOCODE && $this->yyidx >= 0); } + /** + * @param $token + * + * @return bool + */ public function yy_is_expected_token($token) { static $res = array(); @@ -873,6 +944,13 @@ public function yy_is_expected_token($token) return true; } + /** + * @param $yyNewState + * @param $yyMajor + * @param $yypMinor + * + * @throws \SmartyCompilerException + */ public function yy_shift($yyNewState, $yyMajor, $yypMinor) { $this->yyidx++; @@ -911,6 +989,11 @@ public function yy_shift($yyNewState, $yyMajor, $yypMinor) } } + /** + * @param $yyruleno + * + * @throws \SmartyCompilerException + */ public function yy_reduce($yyruleno) { if ($this->yyTraceFILE && $yyruleno >= 0 && $yyruleno < count(self::$yyRuleName)) { @@ -967,6 +1050,12 @@ public function yy_accept() $this->retvalue = $this->_retvalue; } + /** + * @param $yymajor + * @param $TOKEN + * + * @throws \SmartyCompilerException + */ public function yy_syntax_error($yymajor, $TOKEN) { #line 232 "../smarty/lexer/smarty_internal_configfileparser.y" diff --git a/libs/sysplugins/smarty_internal_data.php b/libs/sysplugins/smarty_internal_data.php index e1724f14b..58febbf2b 100644 --- a/libs/sysplugins/smarty_internal_data.php +++ b/libs/sysplugins/smarty_internal_data.php @@ -19,6 +19,7 @@ * The following methods will be dynamically loaded by the extension handler when they are called. * They are located in a corresponding Smarty_Internal_Method_xxxx class * + * @method mixed _getConfigVariable(string $varName, bool $errorEnable = true) * @method mixed getConfigVariable(string $varName, bool $errorEnable = true) * @method mixed getConfigVars(string $varName = null, bool $searchParents = true) * @method mixed getGlobal(string $varName = null) @@ -266,7 +267,7 @@ public function _isSmartyObj() */ public function _getSmartyObj() { - return $this->_objType === 1 ? $this : $this->smarty; + return $this->smarty; } /** diff --git a/libs/sysplugins/smarty_internal_debug.php b/libs/sysplugins/smarty_internal_debug.php index f16bd3fb1..20d723813 100644 --- a/libs/sysplugins/smarty_internal_debug.php +++ b/libs/sysplugins/smarty_internal_debug.php @@ -193,6 +193,9 @@ public static function register_data(Smarty_Data $data) * * @param Smarty_Internal_Template|Smarty $obj object to debug * @param bool $full + * + * @throws \Exception + * @throws \SmartyException */ public function display_debug($obj, $full = false) { diff --git a/libs/sysplugins/smarty_internal_errorhandler.php b/libs/sysplugins/smarty_internal_errorhandler.php index 960877203..831421833 100644 --- a/libs/sysplugins/smarty_internal_errorhandler.php +++ b/libs/sysplugins/smarty_internal_errorhandler.php @@ -25,7 +25,7 @@ class Smarty_Internal_ErrorHandler /** * Enable error handler to mute expected messages * - * @return void + * @return boolean */ public static function muteExpectedErrors() { diff --git a/libs/sysplugins/smarty_internal_method_addautoloadfilters.php b/libs/sysplugins/smarty_internal_method_addautoloadfilters.php index 3eef8a28c..7bd75bfb5 100644 --- a/libs/sysplugins/smarty_internal_method_addautoloadfilters.php +++ b/libs/sysplugins/smarty_internal_method_addautoloadfilters.php @@ -11,7 +11,6 @@ */ class Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters { - /** * Add autoload filters * @@ -25,6 +24,7 @@ class Smarty_Internal_Method_AddAutoloadFilters extends Smarty_Internal_Method_S * the appropriate types * * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException */ public function addAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null) { diff --git a/libs/sysplugins/smarty_internal_method_clearallcache.php b/libs/sysplugins/smarty_internal_method_clearallcache.php index 5879f9a06..9641e2baa 100644 --- a/libs/sysplugins/smarty_internal_method_clearallcache.php +++ b/libs/sysplugins/smarty_internal_method_clearallcache.php @@ -28,7 +28,8 @@ class Smarty_Internal_Method_ClearAllCache * @param integer $exp_time expiration time * @param string $type resource type * - * @return integer number of cache files deleted + * @return int number of cache files deleted + * @throws \SmartyException */ public function clearAllCache(Smarty $smarty, $exp_time = null, $type = null) { diff --git a/libs/sysplugins/smarty_internal_method_clearcache.php b/libs/sysplugins/smarty_internal_method_clearcache.php index 95649a777..6d56c13d5 100644 --- a/libs/sysplugins/smarty_internal_method_clearcache.php +++ b/libs/sysplugins/smarty_internal_method_clearcache.php @@ -31,7 +31,8 @@ class Smarty_Internal_Method_ClearCache * @param integer $exp_time expiration time * @param string $type resource type * - * @return integer number of cache files deleted + * @return int number of cache files deleted + * @throws \SmartyException */ public function clearCache(Smarty $smarty, $template_name, $cache_id = null, $compile_id = null, $exp_time = null, $type = null) diff --git a/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php b/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php index 1d448e5f7..6a3292d0b 100644 --- a/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php +++ b/libs/sysplugins/smarty_internal_method_clearcompiledtemplate.php @@ -29,7 +29,8 @@ class Smarty_Internal_Method_ClearCompiledTemplate * @param string $compile_id compile id * @param integer $exp_time expiration time * - * @return integer number of template files deleted + * @return int number of template files deleted + * @throws \SmartyException */ public function clearCompiledTemplate(Smarty $smarty, $resource_name = null, $compile_id = null, $exp_time = null) { diff --git a/libs/sysplugins/smarty_internal_method_configload.php b/libs/sysplugins/smarty_internal_method_configload.php index 6113eaf98..d33c3d150 100644 --- a/libs/sysplugins/smarty_internal_method_configload.php +++ b/libs/sysplugins/smarty_internal_method_configload.php @@ -30,7 +30,7 @@ class Smarty_Internal_Method_ConfigLoad * section or null * * @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template - * @throws \SmartyException + * @throws \Exception */ public function configLoad(Smarty_Internal_Data $data, $config_file, $sections = null) { @@ -52,7 +52,7 @@ public function configLoad(Smarty_Internal_Data $data, $config_file, $sections = * shall be loaded * * @return \Smarty|\Smarty_Internal_Data|\Smarty_Internal_Template - * @throws \SmartyException + * @throws \Exception */ public function _loadConfigFile(Smarty_Internal_Data $data, $config_file, $sections = null, $scope = 0) { @@ -94,6 +94,7 @@ public function _loadConfigVars(Smarty_Internal_Template $tpl, $new_config_vars) $mergedScope = $tagScope | $tpl->scope; if ($mergedScope) { // update scopes + /* @var \Smarty_Internal_Template|\Smarty|\Smarty_Internal_Data $ptr */ foreach ($tpl->smarty->ext->_updateScope->_getAffectedScopes($tpl->parent, $mergedScope) as $ptr) { $this->_assignConfigVars($ptr->config_vars, $tpl, $new_config_vars); if ($tagScope && $ptr->_isTplObj() && isset($tpl->_cache[ 'varStack' ])) { diff --git a/libs/sysplugins/smarty_internal_method_getautoloadfilters.php b/libs/sysplugins/smarty_internal_method_getautoloadfilters.php index d945a01e3..b957b60d2 100644 --- a/libs/sysplugins/smarty_internal_method_getautoloadfilters.php +++ b/libs/sysplugins/smarty_internal_method_getautoloadfilters.php @@ -11,7 +11,6 @@ */ class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_SetAutoloadFilters { - /** * Get autoload filters * @@ -22,8 +21,9 @@ class Smarty_Internal_Method_GetAutoloadFilters extends Smarty_Internal_Method_S * for. Defaults to all autoload * filters * - * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type + * @return array array( 'type1' => array( 'filter1', 'filter2', … ) ) or array( 'filter1', 'filter2', …) if $type * was specified + * @throws \SmartyException */ public function getAutoloadFilters(Smarty_Internal_TemplateBase $obj, $type = null) { diff --git a/libs/sysplugins/smarty_internal_method_getglobal.php b/libs/sysplugins/smarty_internal_method_getglobal.php index 7a8a9bc71..0f00da53c 100644 --- a/libs/sysplugins/smarty_internal_method_getglobal.php +++ b/libs/sysplugins/smarty_internal_method_getglobal.php @@ -24,9 +24,9 @@ class Smarty_Internal_Method_GetGlobal * @api Smarty::getGlobal() * * @param \Smarty_Internal_Data $data - * @param string $varName variable name or null + * @param string $varName variable name or null * - * @return string variable value or or array of variables + * @return string|array variable value or or array of variables */ public function getGlobal(Smarty_Internal_Data $data, $varName = null) { diff --git a/libs/sysplugins/smarty_internal_method_gettags.php b/libs/sysplugins/smarty_internal_method_gettags.php index 5718b69e9..f195fc469 100644 --- a/libs/sysplugins/smarty_internal_method_gettags.php +++ b/libs/sysplugins/smarty_internal_method_gettags.php @@ -28,6 +28,7 @@ class Smarty_Internal_Method_GetTags * @param null|string|Smarty_Internal_Template $template * * @return array of tag/attributes + * @throws \Exception * @throws \SmartyException */ public function getTags(Smarty_Internal_TemplateBase $obj, $template = null) diff --git a/libs/sysplugins/smarty_internal_method_literals.php b/libs/sysplugins/smarty_internal_method_literals.php index 6dd4e26d1..08e1a473b 100644 --- a/libs/sysplugins/smarty_internal_method_literals.php +++ b/libs/sysplugins/smarty_internal_method_literals.php @@ -43,6 +43,7 @@ public function getLiterals(Smarty_Internal_TemplateBase $obj) * to add * * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException */ public function addLiterals(Smarty_Internal_TemplateBase $obj, $literals = null) { @@ -62,6 +63,7 @@ public function addLiterals(Smarty_Internal_TemplateBase $obj, $literals = null) * to set * * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException */ public function setLiterals(Smarty_Internal_TemplateBase $obj, $literals = null) { diff --git a/libs/sysplugins/smarty_internal_method_setautoloadfilters.php b/libs/sysplugins/smarty_internal_method_setautoloadfilters.php index df5ca6405..ebcfe727b 100644 --- a/libs/sysplugins/smarty_internal_method_setautoloadfilters.php +++ b/libs/sysplugins/smarty_internal_method_setautoloadfilters.php @@ -38,6 +38,7 @@ class Smarty_Internal_Method_SetAutoloadFilters * the appropriate types * * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException */ public function setAutoloadFilters(Smarty_Internal_TemplateBase $obj, $filters, $type = null) { diff --git a/libs/sysplugins/smarty_internal_method_unloadfilter.php b/libs/sysplugins/smarty_internal_method_unloadfilter.php index 9aa1d229b..1a5fdf19b 100644 --- a/libs/sysplugins/smarty_internal_method_unloadfilter.php +++ b/libs/sysplugins/smarty_internal_method_unloadfilter.php @@ -22,7 +22,8 @@ class Smarty_Internal_Method_UnloadFilter extends Smarty_Internal_Method_LoadFil * @param string $type filter type * @param string $name filter name * - * @return bool + * @return Smarty_Internal_TemplateBase + * @throws \SmartyException */ public function unloadFilter(Smarty_Internal_TemplateBase $obj, $type, $name) { diff --git a/libs/sysplugins/smarty_internal_method_unregisterfilter.php b/libs/sysplugins/smarty_internal_method_unregisterfilter.php index c5b88f57d..fcc4e5d89 100644 --- a/libs/sysplugins/smarty_internal_method_unregisterfilter.php +++ b/libs/sysplugins/smarty_internal_method_unregisterfilter.php @@ -23,6 +23,7 @@ class Smarty_Internal_Method_UnregisterFilter extends Smarty_Internal_Method_Reg * @param callback|string $callback * * @return \Smarty|\Smarty_Internal_Template + * @throws \SmartyException */ public function unregisterFilter(Smarty_Internal_TemplateBase $obj, $type, $callback) { diff --git a/libs/sysplugins/smarty_internal_parsetree.php b/libs/sysplugins/smarty_internal_parsetree.php index 32c9df094..b3e202efb 100644 --- a/libs/sysplugins/smarty_internal_parsetree.php +++ b/libs/sysplugins/smarty_internal_parsetree.php @@ -1,7 +1,7 @@ cache_lifetime; } $output = "source->filepath) . "\" */\n\n"; $output .= "/* @var Smarty_Internal_Template \$_smarty_tpl */\n"; $dec = "\$_smarty_tpl->_decodeProperties(\$_smarty_tpl, " . var_export($properties, true) . ',' . diff --git a/libs/sysplugins/smarty_internal_runtime_getincludepath.php b/libs/sysplugins/smarty_internal_runtime_getincludepath.php index 00dbf7b5c..54b1bb3d5 100644 --- a/libs/sysplugins/smarty_internal_runtime_getincludepath.php +++ b/libs/sysplugins/smarty_internal_runtime_getincludepath.php @@ -36,7 +36,7 @@ class Smarty_Internal_Runtime_GetIncludePath /** * stream cache * - * @var string[] + * @var string[][] */ public $isFile = array(); /** diff --git a/libs/sysplugins/smarty_internal_runtime_inheritance.php b/libs/sysplugins/smarty_internal_runtime_inheritance.php index 289e3ba08..cca2c74a0 100644 --- a/libs/sysplugins/smarty_internal_runtime_inheritance.php +++ b/libs/sysplugins/smarty_internal_runtime_inheritance.php @@ -103,6 +103,9 @@ public function init(Smarty_Internal_Template $tpl, $initChild, $blockNames = ar * @param null|string $template optional name of inheritance parent template * @param null|string $uid uid of inline template * @param null|string $func function call name of inline template + * + * @throws \Exception + * @throws \SmartyException */ public function endChild(Smarty_Internal_Template $tpl, $template = null, $uid = null, $func = null) { @@ -135,6 +138,8 @@ public function endChild(Smarty_Internal_Template $tpl, $template = null, $uid = * @param $className * @param string $name * @param int|null $tplIndex index of outer level {block} if nested + * + * @throws \SmartyException */ public function instanceBlock(Smarty_Internal_Template $tpl, $className, $name, $tplIndex = null) { @@ -203,7 +208,8 @@ public function process(Smarty_Internal_Template $tpl, * @param \Smarty_Internal_Block $block * @param boolean $returnContent flag if content shall be returned * - * @return null|string null or block content dependent on $returnContent + * @return null|string null or block content dependent on $returnContent + * @throws \SmartyException */ public function callChild(Smarty_Internal_Template $tpl, Smarty_Internal_Block $block, $returnContent = false) { diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index f950606df..15c79f6aa 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -117,9 +117,11 @@ class Smarty_Internal_Template extends Smarty_Internal_TemplateBase public static $isCacheTplObj = array(); /** - * Subtemplate Info Cache + * Sub template Info Cache + * - index name + * - value use count * - * @var string[]int[] + * @var int[] */ public static $subTplInfo = array(); @@ -170,6 +172,7 @@ public function __construct($template_resource, Smarty $smarty, Smarty_Internal_ * @param null|bool $display true: display, false: fetch null: sub-template * * @return string + * @throws \Exception * @throws \SmartyException */ public function render($no_output_filter = true, $display = null) @@ -269,6 +272,8 @@ public function render($no_output_filter = true, $display = null) * @param string $uid file dependency uid * @param string $content_func function name * + * @throws \Exception + * @throws \SmartyException */ public function _subTemplateRender($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $scope, $forceTplCache, $uid = null, $content_func = null) @@ -528,6 +533,7 @@ public function writeCachedContent($content) * Get unique template id * * @return string + * @throws \SmartyException */ public function _getTemplateId() { diff --git a/libs/sysplugins/smarty_internal_templatebase.php b/libs/sysplugins/smarty_internal_templatebase.php index 463c4b390..ca2b4496a 100644 --- a/libs/sysplugins/smarty_internal_templatebase.php +++ b/libs/sysplugins/smarty_internal_templatebase.php @@ -117,6 +117,9 @@ public function fetch($template = null, $cache_id = null, $compile_id = null, $p * @param mixed $cache_id cache id to be used with this template * @param mixed $compile_id compile id to be used with this template * @param object $parent next higher level of Smarty variables + * + * @throws \Exception + * @throws \SmartyException */ public function display($template = null, $cache_id = null, $compile_id = null, $parent = null) { @@ -135,7 +138,9 @@ public function display($template = null, $cache_id = null, $compile_id = null, * @param mixed $compile_id compile id to be used with this template * @param object $parent next higher level of Smarty variables * - * @return boolean cache status + * @return bool cache status + * @throws \Exception + * @throws \SmartyException */ public function isCached($template = null, $cache_id = null, $compile_id = null, $parent = null) { diff --git a/libs/sysplugins/smarty_internal_templatecompilerbase.php b/libs/sysplugins/smarty_internal_templatecompilerbase.php index 8a38bb872..f34ce4ac9 100644 --- a/libs/sysplugins/smarty_internal_templatecompilerbase.php +++ b/libs/sysplugins/smarty_internal_templatecompilerbase.php @@ -534,6 +534,7 @@ public function compileConfigVariable($variable) * @param array $parameter * * @return string + * @throws \SmartyCompilerException */ public function compilePHPFunctionCall($name, $parameter) { @@ -662,7 +663,8 @@ public function processText($text) * @param mixed $param2 optional parameter * @param mixed $param3 optional parameter * - * @return string|bool compiled code or false + * @return bool|string compiled code or false + * @throws \SmartyCompilerException */ public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $param3 = null) { @@ -680,7 +682,8 @@ public function callTagCompiler($tag, $args, $param1 = null, $param2 = null, $pa * * @param string $tag tag name * - * @return Smarty_Internal_CompileBase|bool tag compiler object or false if not found + * @return bool|\Smarty_Internal_CompileBase tag compiler object or false if not found + * @throws \SmartyCompilerException */ public function getTagCompiler($tag) { @@ -708,6 +711,7 @@ public function getTagCompiler($tag) * @param string $plugin_type type of plugin * * @return string call name of function + * @throws \SmartyException */ public function getPlugin($plugin_name, $plugin_type) { @@ -772,7 +776,8 @@ public function getPlugin($plugin_name, $plugin_type) * @param string $tag name of tag * @param string $plugin_type type of plugin * - * @return boolean true if found + * @return bool true if found + * @throws \SmartyCompilerException */ public function getPluginFromDefaultHandler($tag, $plugin_type) { diff --git a/libs/sysplugins/smarty_internal_templatelexer.php b/libs/sysplugins/smarty_internal_templatelexer.php index 06317c82f..3da1a2dab 100644 --- a/libs/sysplugins/smarty_internal_templatelexer.php +++ b/libs/sysplugins/smarty_internal_templatelexer.php @@ -250,11 +250,17 @@ public function isAutoLiteral() strpos(" \n\t\r", $this->value[ $this->compiler->getLdelLength() ]) !== false : false; } // end function + /** + * @return mixed + */ public function yylex() { return $this->{'yylex' . $this->_yy_state}(); } + /** + * @param $state + */ public function yypushstate($state) { if ($this->yyTraceFILE) { @@ -294,6 +300,9 @@ public function yypopstate() } } + /** + * @param $state + */ public function yybegin($state) { $this->_yy_state = $state; @@ -306,6 +315,10 @@ public function yybegin($state) } } + /** + * @return bool + * @throws \Exception + */ public function yylex1() { if (!isset($this->yy_global_pattern1)) { @@ -366,6 +379,10 @@ function yy_r1_1() $this->token = Smarty_Internal_Templateparser::TP_TEXT; } + /** + * @return bool + * @throws \SmartyCompilerException + */ function yy_r1_2() { preg_match("/[*]{$this->compiler->getRdelPreg()}/", $this->data, $match, PREG_OFFSET_CAPTURE, $this->counter); @@ -400,6 +417,9 @@ function yy_r1_12() $this->yypushstate(self::LITERAL); } // end function + /** + * @return bool + */ function yy_r1_14() { $this->yypushstate(self::TAG); @@ -416,6 +436,10 @@ function yy_r1_19() $this->token = Smarty_Internal_Templateparser::TP_TEXT; } + /** + * @return bool + * @throws \Exception + */ public function yylex2() { if (!isset($this->yy_global_pattern2)) { @@ -548,6 +572,10 @@ function yy_r2_22() $this->taglineno = $this->line; } + /** + * @return bool + * @throws \Exception + */ public function yylex3() { if (!isset($this->yy_global_pattern3)) { @@ -609,6 +637,9 @@ function yy_r3_1() $this->yypopstate(); } + /** + * @return bool + */ function yy_r3_2() { $this->yypushstate(self::TAG); @@ -836,6 +867,10 @@ function yy_r3_59() $this->token = Smarty_Internal_Templateparser::TP_TEXT; } + /** + * @return bool + * @throws \Exception + */ public function yylex4() { if (!isset($this->yy_global_pattern4)) { @@ -913,6 +948,10 @@ function yy_r4_5() $this->token = Smarty_Internal_Templateparser::TP_LITERAL; } // end function + /** + * @return bool + * @throws \Exception + */ public function yylex5() { if (!isset($this->yy_global_pattern5)) { @@ -983,12 +1022,18 @@ function yy_r5_5() $this->token = Smarty_Internal_Templateparser::TP_TEXT; } + /** + * @return bool + */ function yy_r5_7() { $this->yypushstate(self::TAG); return true; } + /** + * @return bool + */ function yy_r5_9() { $this->yypushstate(self::TAG); diff --git a/libs/sysplugins/smarty_internal_templateparser.php b/libs/sysplugins/smarty_internal_templateparser.php index 65697f84a..7f2bb322a 100644 --- a/libs/sysplugins/smarty_internal_templateparser.php +++ b/libs/sysplugins/smarty_internal_templateparser.php @@ -1,10 +1,19 @@ string; } + /** + * @param mixed $offset + * + * @return bool + */ public function offsetExists($offset) { return isset($this->metadata[ $offset ]); } + /** + * @param mixed $offset + * + * @return mixed + */ public function offsetGet($offset) { return $this->metadata[ $offset ]; } + /** + * @param mixed $offset + * @param mixed $value + */ public function offsetSet($offset, $value) { if ($offset === null) { @@ -58,12 +84,18 @@ public function offsetSet($offset, $value) } } + /** + * @param mixed $offset + */ public function offsetUnset($offset) { unset($this->metadata[ $offset ]); } } +/** + * Class TP_yyStackEntry + */ class TP_yyStackEntry { public $stateno; /* The state-number */ @@ -1727,6 +1759,10 @@ function __construct(Smarty_Internal_Templatelexer $lex, Smarty_Internal_Templat $this->security = isset($this->smarty->security_policy) ? $this->smarty->security_policy : false; $this->current_buffer = $this->root_buffer = new Smarty_Internal_ParseTree_Template(); } /* The parser's stack */ + /** + * @param $yymajor + * @param $yypminor + */ public static function yy_destructor($yymajor, $yypminor) { switch ($yymajor) { @@ -1777,6 +1813,10 @@ public function mergePrefixCode($code) return new Smarty_Internal_ParseTree_Tag($this, $this->compiler->processNocacheCode($tmp, true)); } + /** + * @param $TraceFILE + * @param $zTracePrompt + */ public function Trace($TraceFILE, $zTracePrompt) { if (!$TraceFILE) { @@ -1794,6 +1834,11 @@ public function PrintTrace() $this->yyTracePrompt = '
'; } + /** + * @param $tokenType + * + * @return mixed|string + */ public function tokenName($tokenType) { if ($tokenType === 0) { @@ -1833,6 +1878,11 @@ public function __destruct() } } + /** + * @param $token + * + * @return array|mixed + */ public function yy_get_expected_tokens($token) { static $res3 = array(); @@ -1917,6 +1967,11 @@ public function yy_get_expected_tokens($token) return array_unique($expected); } + /** + * @param $token + * + * @return bool + */ public function yy_is_expected_token($token) { static $res = array(); @@ -2006,6 +2061,11 @@ public function yy_is_expected_token($token) return true; } + /** + * @param $iLookAhead + * + * @return int|mixed + */ public function yy_find_shift_action($iLookAhead) { $stateno = $this->yystack[ $this->yyidx ]->stateno; @@ -2040,6 +2100,12 @@ public function yy_find_shift_action($iLookAhead) } } + /** + * @param $stateno + * @param $iLookAhead + * + * @return int|mixed + */ public function yy_find_reduce_action($stateno, $iLookAhead) { /* $stateno = $this->yystack[$this->yyidx]->stateno; */ @@ -2063,6 +2129,14 @@ public function yy_find_reduce_action($stateno, $iLookAhead) } #line 234 "../smarty/lexer/smarty_internal_templateparser.y" + + /** + * @param $yyNewState + * @param $yyMajor + * @param $yypMinor + * + * @throws \SmartyCompilerException + */ public function yy_shift($yyNewState, $yyMajor, $yypMinor) { $this->yyidx++; @@ -3356,6 +3430,11 @@ function yy_r191() $this->_retvalue = new Smarty_Internal_ParseTree_DqContent($this->yystack[ $this->yyidx + 0 ]->minor); } + /** + * @param $yyruleno + * + * @throws \SmartyCompilerException + */ public function yy_reduce($yyruleno) { if ($this->yyTraceFILE && $yyruleno >= 0 @@ -3407,6 +3486,12 @@ public function yy_parse_failed() } } + /** + * @param $yymajor + * @param $TOKEN + * + * @throws \SmartyCompilerException + */ public function yy_syntax_error($yymajor, $TOKEN) { #line 214 "../smarty/lexer/smarty_internal_templateparser.y" @@ -3429,6 +3514,12 @@ public function yy_accept() $this->retvalue = $this->_retvalue; } + /** + * @param $yymajor + * @param $yytokenvalue + * + * @throws \SmartyCompilerException + */ public function doParse($yymajor, $yytokenvalue) { $yyerrorhit = 0; /* True if yymajor has invoked an error */ diff --git a/libs/sysplugins/smarty_resource.php b/libs/sysplugins/smarty_resource.php index 4aaafa4d2..b76b9c783 100644 --- a/libs/sysplugins/smarty_resource.php +++ b/libs/sysplugins/smarty_resource.php @@ -133,6 +133,7 @@ public static function parseResourceName($resource_name, $default_resource) * @param string $template_resource template_resource to extract resource handler and name of * * @return string unique resource name + * @throws \SmartyException */ public static function getUniqueTemplateName($obj, $template_resource) { @@ -159,7 +160,8 @@ public static function getUniqueTemplateName($obj, $template_resource) * @param Smarty $smarty smarty object * @param string $template_resource resource identifier * - * @return Smarty_Template_Source Source Object + * @return \Smarty_Template_Source Source Object + * @throws \SmartyException */ public static function source(Smarty_Internal_Template $_template = null, Smarty $smarty = null, @@ -239,6 +241,9 @@ public function getBasename(Smarty_Template_Source $source) return basename(preg_replace('![^\w]+!', '_', $source->name)); } + /** + * @return bool + */ public function checkTimestamps() { return true; diff --git a/libs/sysplugins/smarty_resource_recompiled.php b/libs/sysplugins/smarty_resource_recompiled.php index 7e51d1b1d..1465124c8 100644 --- a/libs/sysplugins/smarty_resource_recompiled.php +++ b/libs/sysplugins/smarty_resource_recompiled.php @@ -85,6 +85,9 @@ public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Sma * * @return bool */ + /** + * @return bool + */ public function checkTimestamps() { return false; diff --git a/libs/sysplugins/smarty_security.php b/libs/sysplugins/smarty_security.php index 4f75f7529..60abd2ef7 100644 --- a/libs/sysplugins/smarty_security.php +++ b/libs/sysplugins/smarty_security.php @@ -676,7 +676,7 @@ public static function enableSecurity(Smarty $smarty, $security_class) { if ($security_class instanceof Smarty_Security) { $smarty->security_policy = $security_class; - return; + return $smarty; } elseif (is_object($security_class)) { throw new SmartyException("Class '" . get_class($security_class) . "' must extend Smarty_Security."); } @@ -690,7 +690,7 @@ public static function enableSecurity(Smarty $smarty, $security_class) } else { $smarty->security_policy = new $security_class($smarty); } - return; + return $smarty; } /** * Start template processing diff --git a/libs/sysplugins/smarty_template_cached.php b/libs/sysplugins/smarty_template_cached.php index 58f0daf28..59eb09ad7 100644 --- a/libs/sysplugins/smarty_template_cached.php +++ b/libs/sysplugins/smarty_template_cached.php @@ -83,6 +83,8 @@ class Smarty_Template_Cached extends Smarty_Template_Resource_Base * create Cached Object container * * @param Smarty_Internal_Template $_template template object + * + * @throws \SmartyException */ public function __construct(Smarty_Internal_Template $_template) { diff --git a/libs/sysplugins/smarty_template_compiled.php b/libs/sysplugins/smarty_template_compiled.php index b45cd8b12..d82d23b12 100644 --- a/libs/sysplugins/smarty_template_compiled.php +++ b/libs/sysplugins/smarty_template_compiled.php @@ -201,7 +201,8 @@ public function compileTemplateSource(Smarty_Internal_Template $_template) * @param Smarty_Internal_Template $_template template object * @param string $code compiled code * - * @return boolean success + * @return bool success + * @throws \SmartyException */ public function write(Smarty_Internal_Template $_template, $code) { diff --git a/libs/sysplugins/smarty_template_resource_base.php b/libs/sysplugins/smarty_template_resource_base.php index 6cc008a10..eb262ab0b 100644 --- a/libs/sysplugins/smarty_template_resource_base.php +++ b/libs/sysplugins/smarty_template_resource_base.php @@ -80,9 +80,11 @@ abstract class Smarty_Template_Resource_Base public $required_plugins = array(); /** - * Included subtemplates + * Included sub templates + * - index name + * - value use count * - * @var array + * @var int[] */ public $includes = array(); diff --git a/libs/sysplugins/smarty_template_source.php b/libs/sysplugins/smarty_template_source.php index fdb3deaa8..4868706c8 100644 --- a/libs/sysplugins/smarty_template_source.php +++ b/libs/sysplugins/smarty_template_source.php @@ -126,12 +126,13 @@ class Smarty_Template_Source /** * create Source Object container * - * @param Smarty_Resource $handler Resource Handler this source object communicates with - * @param Smarty $smarty Smarty instance this source object belongs to - * @param string $resource full template_resource - * @param string $type type of resource - * @param string $name resource name + * @param Smarty $smarty Smarty instance this source object belongs to + * @param string $resource full template_resource + * @param string $type type of resource + * @param string $name resource name * + * @throws \SmartyException + * @internal param \Smarty_Resource $handler Resource Handler this source object communicates with */ public function __construct(Smarty $smarty, $resource, $type, $name) { @@ -202,6 +203,7 @@ public function getTimeStamp() * Get source content * * @return string + * @throws \SmartyException */ public function getContent() { diff --git a/libs/sysplugins/smarty_undefined_variable.php b/libs/sysplugins/smarty_undefined_variable.php index 88bc6f68c..67e8714fe 100644 --- a/libs/sysplugins/smarty_undefined_variable.php +++ b/libs/sysplugins/smarty_undefined_variable.php @@ -7,22 +7,18 @@ * @package Smarty * @subpackage Template */ -class Smarty_Undefined_Variable +class Smarty_Undefined_Variable extends Smarty_Variable { /** - * Returns FALSE for 'nocache' and NULL otherwise. + * Returns null for not existing properties * * @param string $name * - * @return bool + * @return null */ public function __get($name) { - if ($name == 'nocache') { - return false; - } else { return null; - } } /** diff --git a/libs/sysplugins/smartycompilerexception.php b/libs/sysplugins/smartycompilerexception.php index 763bab159..f7ad39b93 100644 --- a/libs/sysplugins/smartycompilerexception.php +++ b/libs/sysplugins/smartycompilerexception.php @@ -7,6 +7,9 @@ */ class SmartyCompilerException extends SmartyException { + /** + * @return string + */ public function __toString() { return ' --> Smarty Compiler: ' . $this->message . ' <-- '; diff --git a/libs/sysplugins/smartyexception.php b/libs/sysplugins/smartyexception.php index 431d8f8e9..7f7b9aa43 100644 --- a/libs/sysplugins/smartyexception.php +++ b/libs/sysplugins/smartyexception.php @@ -9,6 +9,9 @@ class SmartyException extends Exception { public static $escape = false; + /** + * @return string + */ public function __toString() { return ' --> Smarty: ' . (self::$escape ? htmlentities($this->message) : $this->message) . ' <-- ';