Page MenuHomeCode

No OneTemporary

diff --git a/Engines/Templates/Smarty/Plugins/modifier.romanize.php b/Engines/Templates/Smarty/Plugins/modifier.romanize.php
index a9f00a1..7ad3f2b 100644
--- a/Engines/Templates/Smarty/Plugins/modifier.romanize.php
+++ b/Engines/Templates/Smarty/Plugins/modifier.romanize.php
@@ -1,34 +1,31 @@
<?php
declare(strict_types=1);
/**
* Smarty plugin
*
* @package Smarty
* @subpackage PluginsModifier
*/
use Keruald\OmniTools\Culture\Rome\RomanNumerals;
/**
* Smarty romanize modifier plugin
*
* Type: modifier<br>
* Name: romanize<br>
* Purpose: prints a number in roman
-*
-* @param int $
-* @return string
*/
-function smarty_modifier_romanize ($number) : string {
+function smarty_modifier_romanize (mixed $number) : string {
if (!is_numeric($number)) {
return (string)$number;
}
try {
return RomanNumerals::fromHinduArabic((int)$number);
} catch (InvalidArgumentException $ex) {
// Not a strictly positive integer, don't modify
return (string)$number;
}
}
diff --git a/Engines/Templates/Smarty/Plugins/modifier.text2html.php b/Engines/Templates/Smarty/Plugins/modifier.text2html.php
index 3a02396..bc1235a 100644
--- a/Engines/Templates/Smarty/Plugins/modifier.text2html.php
+++ b/Engines/Templates/Smarty/Plugins/modifier.text2html.php
@@ -1,42 +1,40 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty text to HTML modifier plugin
*
* Type: modifier<br>
* Name: text2html<br>
* Purpose: HTML representation for Azhàr profiles
* @author Wolfaeym
- * @param string
- * @return string
*/
-function smarty_modifier_text2html ($string) {
+function smarty_modifier_text2html (string $string): string {
//HTML entities
$string = htmlspecialchars($string, ENT_QUOTES);
//E-mail -> mailto links
$string = preg_replace(
"/([_a-z0-9-]+(\._a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)+)/i",
"<a href=\"mailto:\\1\">\\1</A>",
$string
);
//Linkify URLs
//TODO handle www.
//TODO Relative links for current domain
$string = preg_replace(
"@([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])@i",
"<a href=\"\\1://\\2\\3\">\\1://\\2\\3</a>", $string
);
//\n -> <br />
$string = nl2br($string);
return $string;
}
diff --git a/Engines/Templates/Smarty/Plugins/modifier.yyyymmdd.php b/Engines/Templates/Smarty/Plugins/modifier.yyyymmdd.php
index 0065498..1c79217 100644
--- a/Engines/Templates/Smarty/Plugins/modifier.yyyymmdd.php
+++ b/Engines/Templates/Smarty/Plugins/modifier.yyyymmdd.php
@@ -1,22 +1,20 @@
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty lower modifier plugin
*
* Type: modifier<br>
* Name: yyyymmdd<br>
* Purpose: Appends dashes to yyyymmdd string to output yyyy-mm-dd
* @author Wolfaeym
- * @param string
- * @return string
*/
-function smarty_modifier_yyyymmdd($string) {
+function smarty_modifier_yyyymmdd(string $string) : string {
return substr($string, 0, 4) . '-' . substr($string, 4, 2)
. '-' . substr($string, 6, 2);
}

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 05:48 (5 h, 7 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
21197
Default Alt Text
(3 KB)

Event Timeline