From e0e94ecb782dd68953a539686fc69792a32687f6 Mon Sep 17 00:00:00 2001 From: Serge Rodovnichenko Date: Sat, 5 Apr 2025 01:35:08 +0300 Subject: [PATCH] fix 8.4 deprecations in Smarty sysplugins --- .../sysplugins/smarty_cacheresource.php | 4 ++-- .../smarty_cacheresource_custom.php | 4 ++-- .../smarty_cacheresource_keyvaluestore.php | 4 ++-- .../smarty_internal_cacheresource_file.php | 14 ++++++------- .../smarty_internal_resource_eval.php | 6 +++--- .../smarty_internal_resource_extends.php | 13 ++++++------ .../smarty_internal_resource_file.php | 7 ++++--- .../smarty_internal_resource_php.php | 5 +++-- .../smarty_internal_resource_registered.php | 6 +++--- .../smarty_internal_resource_stream.php | 15 ++++++------- .../smarty_internal_resource_string.php | 6 +++--- .../smarty3/sysplugins/smarty_resource.php | 21 ++++++++++--------- .../sysplugins/smarty_resource_custom.php | 6 +++--- 13 files changed, 58 insertions(+), 53 deletions(-) diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource.php b/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource.php index a6852998b..ef276b151 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource.php @@ -49,10 +49,10 @@ public abstract function populateTimestamp(Smarty_Template_Cached $cached); * Read the cached template and process header * * @param Smarty_Internal_Template $_template template object - * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Template_Cached|null $cached cached object * @return booelan true or false if the cached content does not exist */ - public abstract function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null); + public abstract function process(Smarty_Internal_Template $_template, ?Smarty_Template_Cached $cached=null); /** * Write the rendered template output to cache diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_custom.php b/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_custom.php index ee9de157b..471275aa7 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_custom.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_custom.php @@ -109,10 +109,10 @@ public function populateTimestamp(Smarty_Template_Cached $cached) * Read the cached template and process the header * * @param Smarty_Internal_Template $_template template object - * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Template_Cached|null $cached cached object * @return booelan true or false if the cached content does not exist */ - public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null) + public function process(Smarty_Internal_Template $_template, ?Smarty_Template_Cached $cached=null) { if (!$cached) { $cached = $_template->cached; diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_keyvaluestore.php b/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_keyvaluestore.php index dff9b65aa..2b6728018 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_keyvaluestore.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_cacheresource_keyvaluestore.php @@ -81,10 +81,10 @@ public function populateTimestamp(Smarty_Template_Cached $cached) * Read the cached template and process the header * * @param Smarty_Internal_Template $_template template object - * @param Smarty_Template_Cached $cached cached object + * @param Smarty_Template_Cached|null $cached cached object * @return booelan true or false if the cached content does not exist */ - public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null) + public function process(Smarty_Internal_Template $_template, ?Smarty_Template_Cached $cached=null) { if (!$cached) { $cached = $_template->cached; diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_cacheresource_file.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_cacheresource_file.php index fca897d9f..22ebea9c8 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_cacheresource_file.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_cacheresource_file.php @@ -78,13 +78,13 @@ public function populateTimestamp(Smarty_Template_Cached $cached) } /** - * Read the cached template and process its header - * - * @param Smarty_Internal_Template $_template template object - * @param Smarty_Template_Cached $cached cached object - * @return booelan true or false if the cached content does not exist - */ - public function process(Smarty_Internal_Template $_template, Smarty_Template_Cached $cached=null) + * Read the cached template and process its header + * + * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Cached|null $cached cached object + * @return booelan true or false if the cached content does not exist + */ + public function process(Smarty_Internal_Template $_template, ?Smarty_Template_Cached $cached=null) { $_smarty_tpl = $_template; return @include $_template->cached->filepath; diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_eval.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_eval.php index cf2ec3e1c..7ad9b2ace 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_eval.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_eval.php @@ -23,11 +23,11 @@ class Smarty_Internal_Resource_Eval extends Smarty_Resource_Recompiled { /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object * @return void */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $source->uid = $source->filepath = sha1($source->name); $source->timestamp = false; diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_extends.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_extends.php index 29734ae05..b5e78b801 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_extends.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_extends.php @@ -26,12 +26,13 @@ class Smarty_Internal_Resource_Extends extends Smarty_Resource { public $mbstring_overload = 0; /** - * populate Source Object with meta data from Resource - * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object - */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + * populate Source Object with meta data from Resource + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object + * @throws SmartyException + */ + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $uid = ''; $sources = array(); diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_file.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_file.php index 3fbe31034..689a8f17e 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_file.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_file.php @@ -22,10 +22,11 @@ class Smarty_Internal_Resource_File extends Smarty_Resource { /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object + * @throws SmartyException */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $source->filepath = $this->buildFilepath($source, $_template); diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_php.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_php.php index 7cd8baeec..164478eb9 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_php.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_php.php @@ -30,10 +30,11 @@ public function __construct() * populate Source Object with meta data from Resource * * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Internal_Template|null $_template template object * @return void + * @throws SmartyException */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $source->filepath = $this->buildFilepath($source, $_template); diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_registered.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_registered.php index 44497b922..f371b7311 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_registered.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_registered.php @@ -22,11 +22,11 @@ class Smarty_Internal_Resource_Registered extends Smarty_Resource { /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object * @return void */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $source->filepath = $source->type . ':' . $source->name; $source->uid = sha1($source->filepath); diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_stream.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_stream.php index 58086c179..9acd651e5 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_stream.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_stream.php @@ -22,13 +22,14 @@ class Smarty_Internal_Resource_Stream extends Smarty_Resource_Recompiled { /** - * populate Source Object with meta data from Resource - * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object - * @return void - */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + * populate Source Object with meta data from Resource + * + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object + * @return void + * @throws SmartyException + */ + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { if(strpos($source->resource, '://') !== false) { $source->filepath = $source->resource; diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_string.php b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_string.php index 9571337b0..9dbe8b158 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_string.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_internal_resource_string.php @@ -23,11 +23,11 @@ class Smarty_Internal_Resource_String extends Smarty_Resource { /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object * @return void */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $source->uid = $source->filepath = sha1($source->name); $source->timestamp = 0; diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_resource.php b/wa-system/vendors/smarty3/sysplugins/smarty_resource.php index dff536f17..bc8a37912 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_resource.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_resource.php @@ -77,10 +77,10 @@ public abstract function getContent(Smarty_Template_Source $source); /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object */ - public abstract function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null); + public abstract function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null); /** * populate Source Object with timestamp and exists from Resource @@ -194,12 +194,12 @@ protected function normalizePath($_path, $ds=true) /** * build template filepath by traversing the template_dir array * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object * @return string fully qualified filepath * @throws SmartyException if default template handler is registered but not callable */ - protected function buildFilepath(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + protected function buildFilepath(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $file = $source->name; if ($source instanceof Smarty_Config_Source) { @@ -499,12 +499,13 @@ public static function getUniqueTemplateName($smarty, $template_resource) * * Either [$_template] or [$smarty, $template_resource] must be specified * - * @param Smarty_Internal_Template $_template template object - * @param Smarty $smarty smarty object - * @param string $template_resource resource identifier + * @param Smarty_Internal_Template|null $_template template object + * @param Smarty|null $smarty smarty object + * @param null $template_resource resource identifier * @return Smarty_Template_Source Source Object + * @throws SmartyException */ - public static function source(Smarty_Internal_Template $_template=null, Smarty $smarty=null, $template_resource=null) + public static function source(?Smarty_Internal_Template $_template=null, ?Smarty $smarty=null, $template_resource=null) { if ($_template) { $smarty = $_template->smarty; diff --git a/wa-system/vendors/smarty3/sysplugins/smarty_resource_custom.php b/wa-system/vendors/smarty3/sysplugins/smarty_resource_custom.php index 9ec1f356b..ccb19e0fe 100644 --- a/wa-system/vendors/smarty3/sysplugins/smarty_resource_custom.php +++ b/wa-system/vendors/smarty3/sysplugins/smarty_resource_custom.php @@ -43,10 +43,10 @@ protected function fetchTimestamp($name) /** * populate Source Object with meta data from Resource * - * @param Smarty_Template_Source $source source object - * @param Smarty_Internal_Template $_template template object + * @param Smarty_Template_Source $source source object + * @param Smarty_Internal_Template|null $_template template object */ - public function populate(Smarty_Template_Source $source, Smarty_Internal_Template $_template=null) + public function populate(Smarty_Template_Source $source, ?Smarty_Internal_Template $_template=null) { $source->filepath = strtolower($source->type . ':' . $source->name); $source->uid = sha1($source->type . ':' . $source->name);