From 6d9498950edca4438943b8d0c620c129eaf4c101 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Wed, 11 Dec 2019 04:27:39 +0100 Subject: [PATCH] Add function parameter and return types --- Utils/Slugger.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Utils/Slugger.php b/Utils/Slugger.php index 2172515..8a2856d 100644 --- a/Utils/Slugger.php +++ b/Utils/Slugger.php @@ -66,7 +66,7 @@ class Slugger { } //Short the string - public function short($string) { + public function short(string $string): string { //Return string $ret = ''; @@ -83,7 +83,7 @@ class Slugger { } //Unshort the string - public function unshort($string) { + public function unshort(string $string): string { //Return string $ret = ''; @@ -98,12 +98,12 @@ class Slugger { } //Crypt and base64uri encode string - public function hash($string) { + public function hash(string $string): string { return str_replace(['+','/'], ['-','_'], base64_encode(crypt($string, $this->secret))); } //Convert string to safe slug - function slug($string) { + function slug(string $string): string { return preg_replace('/[\/_|+ -]+/', '-', strtolower(trim(preg_replace('/[^a-zA-Z0-9\/_|+ -]/', '', str_replace(['\'', '"'], ' ', iconv('UTF-8', 'ASCII//TRANSLIT', $string))), '-'))); } } -- 2.41.1