[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [FIX] Remove the hard typing in the handle definition.

"Jonny Bradley \(@jonnybradley\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <697bb8d3e48e4_3b183a6c141c9@gitlab-sidekiq-low-urgency-cpu-bound-v2-86649c4bfc-6v5bj.mail>

Jonny Bradley pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
0e083614 by Jonny Bradley at 2026-01-29T19:38:40+00:00
[FIX] Remove the hard typing in the handle definition.
---
* [FIX] Remove the hard typing in the handle definition.
---
* [FIX] Remove the hard typing in the handle definition.

See merge request tikiwiki/tiki!7744


(cherry picked from commit 6c36a8c322ff3660611b173c3d210597691721a2)

82aca33a [FIX] Remove the hard typing in the handle definition.

Co-authored-by: NasserNgandu <[email protected]>

See merge request tikiwiki/tiki!9443

Needed following backport of 27e34908 - oops!

- - - - -


4 changed files:

- lib/smarty_tiki/Modifier/TikiDateFormat.php
- lib/smarty_tiki/Modifier/TikiShortDateTime.php
- lib/smarty_tiki/modifier.tiki_date_format.php
- lib/tikilib.php


Changes:

=====================================
lib/smarty_tiki/Modifier/TikiDateFormat.php
=====================================
@@ -22,14 +22,12 @@ namespace SmartyTiki\Modifier;
 class TikiDateFormat
 {
     /**
-     * @param string $string the string representing the date to be formatted.
-     * @param string $format the desired date format.
-     * @param string|false $_user if specified, use this user's timezone instead of the current user's, if specified forceTimezone must be false.
-     * @param string|false $forceTimezone the time zone to be applied. Can be a timezone identifier or false, if user is not false forceTimezone must always be false.
-     *
-     * @return string
+     * @param $string the string representing the date to be formatted.
+     * @param $format the desired date format.
+     * @param $_user if specified, use this user's timezone instead of the current user's, if specified forceTimezone must be false.
+     * @param $forceTimezone the time zone to be applied. Can be a timezone identifier or false, if user is not false forceTimezone must always be false.
      */
-    public function handle(string $string, string $format, string|false $_user = false, string|false $forceTimezone = false): string
+    public function handle($string, $format, $_user = false, $forceTimezone = false)
     {
         return \TikiLib::date_format(tra($format), $string, $_user, 5, true, $forceTimezone);
     }


=====================================
lib/smarty_tiki/Modifier/TikiShortDateTime.php
=====================================
@@ -15,7 +15,7 @@ class TikiShortDateTime
      * @param string $string
      * @param string $intro
      * @param string $same if set to 'n' will bypass timeago preferences. Useful when markup is illegal in date
-     * @param bool|string $forceTimezone the time zone to be applied. Can be a timezone identifier or false, if user is not false forceTimezone must always be false
+     * @param $forceTimezone the time zone to be applied. Can be a timezone identifier or false, if user is not false forceTimezone must always be false
      *
      * @return string
      */


=====================================
lib/smarty_tiki/modifier.tiki_date_format.php
=====================================
@@ -5,15 +5,13 @@
 // All Rights Reserved. See copyright.txt for details and a complete list of authors.
 // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
 /**
- * @param string $string the string representing the date to be formatted.
- * @param string $format the desired date format.
- * @param string|false $_user if specified, use this user's timezone instead of the current user's, if specified forceTimezone must be false.
- * @param string|false $forceTimezone the time zone to be applied. Can be a timezone identifier or false, if user is not false forceTimezone must always be false.
- *
- * @return string
+ * @param $string the string representing the date to be formatted.
+ * @param $format the desired date format.
+ * @param $_user if specified, use this user's timezone instead of the current user's, if specified forceTimezone must be false.
+ * @param $forceTimezone the time zone to be applied. Can be a timezone identifier or false, if user is not false forceTimezone must always be false.
  */
 
-function smarty_modifier_tiki_date_format(string $string, string $format, string|false $_user = false, string|false $forceTimezone = false): string
+function smarty_modifier_tiki_date_format($string, $format, $_user = false, $forceTimezone = false)
 {
     $tikiDateFormatModifier = new \SmartyTiki\Modifier\TikiDateFormat();
     return $tikiDateFormatModifier->handle($string, $format, $_user, $forceTimezone);


=====================================
lib/tikilib.php
=====================================
@@ -5795,16 +5795,16 @@ class TikiLib extends TikiDb_Bridge
     }
 
     /**
-     * @param string $format the desired date format.
+     * @param $format the desired date format.
      * @param int|false $timestamp The timestamp to be formatted. Can be an integer representing a UNIX timestamp or false.
-     * @param string|false $_user if specified, use this user's timezone instead of the current user's, if specified forceTimezone must be false.
+     * @param bool $_user if specified, use this user's timezone instead of the current user's, if specified forceTimezone must be false.
      * @param int $input_format Input format, default 5 (DATE_FORMAT_UNIXTIME).
      * @param bool $is_strftime_format indicates whether the format is strftime.
      * @param string|false $forceTimezone the time zone to be applied. Can be a timezone identifier or false, if user is not false forceTimezone must always be false.
      *
      * @return string
      */
-    public static function date_format(string $format, int|false $timestamp = false, string|false $_user = false, int $input_format = 5, bool $is_strftime_format = true, string|false $forceTimezone = false): string
+    public static function date_format($format, $timestamp = false, $_user = false, $input_format = 5, $is_strftime_format = true, $forceTimezone = false)
     {
         global $user;
         $tikilib = TikiLib::lib('tiki');



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0e0836148bd2322e6d11cc43ca02b034b2e14663

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/0e0836148bd2322e6d11cc43ca02b034b2e14663
You're receiving this email because of your account on gitlab.com.

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.