diff --git a/demo/plugins/resource.extendsall.php b/demo/plugins/resource.extendsall.php index b6e46393..6441b47a 100644 --- a/demo/plugins/resource.extendsall.php +++ b/demo/plugins/resource.extendsall.php @@ -1,5 +1,8 @@ smarty->getTemplateVars()`. These Resources simply echo their rendered content to the output stream. The rendered output will be output-cached if the Smarty instance was configured accordingly. See -`libs/sysplugins/smarty_internal_resource_php.php` for an example. +`src/Resource/PhpPlugin.php` for an example. If the Resource\'s compiled templates should not be cached on disk, the Custom Resource may extend `Smarty_Resource_Recompiled`. These Resources are compiled every time they are accessed. This may be an expensive -overhead. See `libs/sysplugins/smarty_internal_resource_eval.php` for an +overhead. See `src/Resource/StringEval.php` for an example. diff --git a/plugins/block.textformat.php b/plugins/block.textformat.php index 290e5795..3935a4a1 100644 --- a/plugins/block.textformat.php +++ b/plugins/block.textformat.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsBlock */ + +use Smarty\Template; + /** * Smarty {textformat}{/textformat} block plugin * Type: block function @@ -25,14 +28,14 @@ * * @param array $params parameters * @param string $content contents of the block - * @param Smarty_Internal_Template $template template object + * @param Template $template template object * @param boolean &$repeat repeat flag * * @return string content re-formatted * @author Monte Ohrt * @throws \SmartyException */ -function smarty_block_textformat($params, $content, Smarty_Internal_Template $template, &$repeat) +function smarty_block_textformat($params, $content, Template $template, &$repeat) { if (is_null($content)) { return; diff --git a/plugins/function.counter.php b/plugins/function.counter.php index 54795459..7884d4c1 100644 --- a/plugins/function.counter.php +++ b/plugins/function.counter.php @@ -5,20 +5,23 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {counter} function plugin * Type: function * Name: counter * Purpose: print out a counter value * - * @author Monte Ohrt - * @link https://www.smarty.net/manual/en/language.function.counter.php {counter} - * (Smarty online manual) - * * @param array $params parameters - * @param Smarty_Internal_Template $template template object + * @param Template $template template object * * @return string|null + *@link https://www.smarty.net/manual/en/language.function.counter.php {counter} + * (Smarty online manual) + * + * @author Monte Ohrt */ function smarty_function_counter($params, $template) { diff --git a/plugins/function.cycle.php b/plugins/function.cycle.php index 79356999..c45c18f3 100644 --- a/plugins/function.cycle.php +++ b/plugins/function.cycle.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {cycle} function plugin * Type: function @@ -37,7 +40,7 @@ * @version 1.3 * * @param array $params parameters - * @param Smarty_Internal_Template $template template object + * @param Template $template template object * * @return string|null */ diff --git a/plugins/function.fetch.php b/plugins/function.fetch.php index d6b777e0..745846f9 100644 --- a/plugins/function.fetch.php +++ b/plugins/function.fetch.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {fetch} plugin * Type: function @@ -16,7 +19,7 @@ * @author Monte Ohrt * * @param array $params parameters - * @param Smarty_Internal_Template $template template object + * @param Template $template template object * * @throws SmartyException * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable diff --git a/plugins/function.html_checkboxes.php b/plugins/function.html_checkboxes.php index e41de2de..81a44dd3 100644 --- a/plugins/function.html_checkboxes.php +++ b/plugins/function.html_checkboxes.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {html_checkboxes} function plugin * File: function.html_checkboxes.php @@ -36,13 +39,13 @@ * @version 1.0 * * @param array $params parameters - * @param Smarty_Internal_Template $template template object + * @param Template $template template object * * @return string * @uses smarty_function_escape_special_chars() * @throws \SmartyException */ -function smarty_function_html_checkboxes($params, Smarty_Internal_Template $template) +function smarty_function_html_checkboxes($params, Template $template) { $name = 'checkbox'; $values = null; diff --git a/plugins/function.html_image.php b/plugins/function.html_image.php index ad39a8b1..055d6e61 100644 --- a/plugins/function.html_image.php +++ b/plugins/function.html_image.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {html_image} function plugin * Type: function @@ -28,13 +31,13 @@ * @version 1.0 * * @param array $params parameters - * @param Smarty_Internal_Template $template template object + * @param Template $template template object * * @throws SmartyException * @return string * @uses smarty_function_escape_special_chars() */ -function smarty_function_html_image($params, Smarty_Internal_Template $template) +function smarty_function_html_image($params, Template $template) { $alt = ''; $file = ''; diff --git a/plugins/function.html_options.php b/plugins/function.html_options.php index 905e35a2..73afdd80 100644 --- a/plugins/function.html_options.php +++ b/plugins/function.html_options.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {html_options} function plugin * Type: function @@ -28,13 +31,13 @@ * * @param array $params parameters * - * @param \Smarty_Internal_Template $template + * @param \Smarty\Template $template * * @return string * @uses smarty_function_escape_special_chars() * @throws \SmartyException */ -function smarty_function_html_options($params, Smarty_Internal_Template $template) +function smarty_function_html_options($params, Template $template) { $name = null; $values = null; diff --git a/plugins/function.html_radios.php b/plugins/function.html_radios.php index 96aa8ef6..ec1453a9 100644 --- a/plugins/function.html_radios.php +++ b/plugins/function.html_radios.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {html_radios} function plugin * File: function.html_radios.php @@ -36,13 +39,13 @@ * @version 1.0 * * @param array $params parameters - * @param Smarty_Internal_Template $template template object + * @param Template $template template object * * @return string * @uses smarty_function_escape_special_chars() * @throws \SmartyException */ -function smarty_function_html_radios($params, Smarty_Internal_Template $template) +function smarty_function_html_radios($params, Template $template) { $name = 'radio'; $values = null; diff --git a/plugins/function.html_select_date.php b/plugins/function.html_select_date.php index b84a547e..77483abe 100644 --- a/plugins/function.html_select_date.php +++ b/plugins/function.html_select_date.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {html_select_date} plugin * Type: function @@ -37,12 +40,12 @@ * * @param array $params parameters * - * @param \Smarty_Internal_Template $template + * @param \Smarty\Template $template * * @return string * @throws \SmartyException */ -function smarty_function_html_select_date($params, Smarty_Internal_Template $template) +function smarty_function_html_select_date($params, Template $template) { // generate timestamps used for month names only static $_month_timestamps = null; diff --git a/plugins/function.html_select_time.php b/plugins/function.html_select_time.php index 9f15d7da..30c25b21 100644 --- a/plugins/function.html_select_time.php +++ b/plugins/function.html_select_time.php @@ -5,6 +5,9 @@ * @package Smarty * @subpackage PluginsFunction */ + +use Smarty\Template; + /** * Smarty {html_select_time} function plugin * Type: function @@ -18,13 +21,13 @@ * * @param array $params parameters * - * @param \Smarty_Internal_Template $template + * @param \Smarty\Template $template * * @return string * @uses smarty_make_timestamp() * @throws \SmartyException */ -function smarty_function_html_select_time($params, Smarty_Internal_Template $template) +function smarty_function_html_select_time($params, Template $template) { $prefix = 'Time_'; $field_array = null; @@ -139,7 +142,7 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem isset($params[ 'time' ][ $prefix . 'Meridian' ]) ? (' ' . $params[ 'time' ][ $prefix . 'Meridian' ]) : ''; $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian); - list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); + [$_hour, $_minute, $_second] = $time = explode('-', date('H-i-s', $time)); } elseif (isset($params[ 'time' ][ $field_array ][ $prefix . 'Hour' ])) { // $_REQUEST given foreach (array( @@ -154,19 +157,19 @@ function smarty_function_html_select_time($params, Smarty_Internal_Template $tem $_meridian = isset($params[ 'time' ][ $field_array ][ $prefix . 'Meridian' ]) ? (' ' . $params[ 'time' ][ $field_array ][ $prefix . 'Meridian' ]) : ''; $time = strtotime($_hour . ':' . $_minute . ':' . $_second . $_meridian); - list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); + [$_hour, $_minute, $_second] = $time = explode('-', date('H-i-s', $time)); } else { // no date found, use NOW - list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d')); + [$_year, $_month, $_day] = $time = explode('-', date('Y-m-d')); } } elseif ($time === null) { if (array_key_exists('time', $params)) { $_hour = $_minute = $_second = $time = null; } else { - list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s')); + [$_hour, $_minute, $_second] = $time = explode('-', date('H-i-s')); } } else { - list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); + [$_hour, $_minute, $_second] = $time = explode('-', date('H-i-s', $time)); } // generate hour