Skip to content

Commit 413372f

Browse files
update
1 parent f328a33 commit 413372f

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

Str.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ static public function formatString($string, $number = 4, $seperator = '-')
339339
{
340340
return implode($seperator, str_split(self::trim($string), $number));
341341
}
342-
342+
343343
/**
344344
* Clean phone string
345345
*
@@ -946,7 +946,7 @@ static public function padString(string $value, int $length, string $padChar = '
946946
*
947947
* @return string The string with converted case
948948
*/
949-
private static function convertCase($string = null, string|null $type)
949+
private static function convertCase($string = null, $type = null)
950950
{
951951
return match (self::lower($type)) {
952952
'upper', 'uppercase', 'upper_case' => self::upper($string),

Tests/str.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,14 @@
3434

3535

3636
dd(
37-
// $changeArrayKeys,
38-
// $removeArrayKeys,
37+
$changeArrayKeys,
38+
$removeArrayKeys,
3939

4040
Str::convertArrayCase(
4141
data: $arrayCollection,
4242
value: 'lower'
4343
),
4444

45-
Str::formatString('892892982982', 5),
4645
Str::snake('Peterso More'),
4746
Str::camel('peterson more'),
4847
Str::studly('peterson more'),
@@ -54,8 +53,8 @@
5453
Str::randomWords(10),
5554
Str::mask('[email protected]', 2, 'left'),
5655
Str::shorten('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 20),
57-
Str::html('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">google.com <script></script></span>'),
58-
Str::text('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">google.com <script></script></span>'),
56+
Str::html('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'),
57+
Str::text('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'),
5958
Str::encrypt('hoping for more'),
6059
Str::decrypt('{"k":"dadb5dd1a0558257","e":"7ZMcZv6tALEVq4k7MHpJCQ==","s":"cUFmY0ZwRlpobVJ6bGxTYUJrVDdydz09"}'),
6160
Str::phone('+234 (90) 012-234'),

helpers.php

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,28 @@ function TameTime($time = null, $timezone = null)
7777
}
7878
}
7979

80-
if (! function_exists('Str')) {
80+
81+
if (! function_exists('TameCollect')) {
82+
/**
83+
* Collection of data
84+
*
85+
* @param array $items
86+
*
87+
* @return \Tamedevelopers\Support\Collections\Collection
88+
*/
89+
function TameCollect($items = [])
90+
{
91+
return new Collection($items);
92+
}
93+
}
94+
95+
if (! function_exists('TameStr')) {
8196
/**
82-
* Str
97+
* Tame Str
8398
*
8499
* @return \Tamedevelopers\Support\Str
85100
*/
86-
function Str()
101+
function TameStr()
87102
{
88103
return new Str();
89104
}
@@ -176,20 +191,6 @@ function server()
176191
}
177192
}
178193

179-
if (! function_exists('collect')) {
180-
/**
181-
* Collection of data
182-
*
183-
* @param array $items
184-
*
185-
* @return \Tamedevelopers\Support\Collections\Collection
186-
*/
187-
function collect($items = [])
188-
{
189-
return new Collection($items);
190-
}
191-
}
192-
193194
if (! function_exists('autoload_register')) {
194195
/**
195196
* Autoload function to load class and files in a given folder

0 commit comments

Comments
 (0)