1
1
<?php
2
+
3
+ /**
4
+ * @Package: some useful php string helper Functions
5
+ * @Author : Nima jahan bakhshian / dvlpr1996 <nimajahanbakhshian@gmail.com>
6
+ * @URL : https://github.com/dvlpr1996
7
+ * @License: MIT License Copyright (c) 2022 (until present) Nima jahan bakhshian
8
+ */
9
+
2
10
declare (strict_types=1 );
3
11
4
12
use PhpStringHelpers \utility \StrUtility as strHelpers ;
@@ -67,7 +75,7 @@ function dotNotation(string $words): string
67
75
}
68
76
69
77
if (!function_exists ('entitiesWrapper ' )) {
70
- function entitiesWrapper (string | int $ data ): string
78
+ function entitiesWrapper ($ data ): string
71
79
{
72
80
return strHelpers::entitiesWrapper ($ data );
73
81
}
@@ -81,23 +89,23 @@ function toSlug(string $string): string
81
89
}
82
90
83
91
if (!function_exists ('rmAllBlanks ' )) {
84
- function rmAllBlanks (string $ words ): string
92
+ function rmAllBlanks (string $ string ): string
85
93
{
86
- return strHelpers::rmAllBlanks ($ words );
94
+ return strHelpers::rmAllBlanks ($ string );
87
95
}
88
96
}
89
97
90
98
if (!function_exists ('alternate ' )) {
91
- function alternate (?string $ string , string $ alternate = null ): string
99
+ function alternate (?string $ string , ? string $ alternate = null ): string
92
100
{
93
101
return strHelpers::alternate ($ string , $ alternate );
94
102
}
95
103
}
96
104
97
105
if (!function_exists ('translate ' )) {
98
- function translate (string $ key , string $ replace = '' , string $ fileName = 'en ' ): string
106
+ function translate (string $ key , string $ replace = '' , string $ dirName = 'en ' ): string
99
107
{
100
- return strHelpers::translate ($ key , $ replace , $ fileName );
108
+ return strHelpers::translate ($ key , $ replace , $ dirName );
101
109
}
102
110
}
103
111
@@ -329,7 +337,7 @@ function rmEndingNumbers(string $string): string
329
337
}
330
338
331
339
if (!function_exists ('convertToUtf8 ' )) {
332
- function convertToUtf8 (string $ string ): string
340
+ function convertToUtf8 (string $ string ): string | bool
333
341
{
334
342
return strHelpers::convertToUtf8 ($ string );
335
343
}
0 commit comments