Skip to content

Commit 5277ad4

Browse files
update
1 parent b702cc3 commit 5277ad4

File tree

2 files changed

+63
-60
lines changed

2 files changed

+63
-60
lines changed

Tests/str.php

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
<?php
2-
3-
use Tamedevelopers\Support\Str;
4-
use Tamedevelopers\Support\Tame;
5-
6-
require_once __DIR__ . '/../vendor/autoload.php';
7-
8-
9-
10-
11-
$arrayCollection = [
12-
0 => [
13-
'id' => 1,
14-
'name' => 'Fred Peter',
15-
'age' => 18,
16-
'is_active' => 1
17-
],
18-
1 => [
19-
'id' => 2,
20-
'name' => 'Cli Patton',
21-
'age' => 25,
22-
'is_active' => 0
23-
]
24-
];
25-
26-
$changeArrayKeys = Str::changeKeysFromArray(
27-
$arrayCollection,
28-
'is_active',
29-
'active'
30-
);
31-
32-
$removeArrayKeys = Str::removeKeysFromArray(
33-
$arrayCollection,
34-
['is_active', 'id']
35-
);
36-
37-
38-
dd(
39-
$changeArrayKeys,
40-
$removeArrayKeys,
41-
42-
Str::snake('Peterso More'),
43-
Str::camel('peterson more'),
44-
Str::studly('peterson more'),
45-
Str::kebab('Peterson More'),
46-
Str::slug('Peterson More'),
47-
Str::slugify('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 'cn'),
48-
Str::random(),
49-
Str::uuid(),
50-
Str::randomWords(10),
51-
Str::mask('[email protected]', 4),
52-
Str::shorten('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 20),
53-
Str::html('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'),
54-
Str::text('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'),
55-
Str::hash('hoping for more'),
56-
Str::phone('+234 (90) 012-234'),
57-
Str::phone('+234 (90) 012-234', false),
58-
);
59-
1+
<?php
2+
3+
use Tamedevelopers\Support\Str;
4+
use Tamedevelopers\Support\Tame;
5+
6+
require_once __DIR__ . '/../vendor/autoload.php';
7+
8+
9+
10+
11+
$arrayCollection = [
12+
0 => [
13+
'id' => 1,
14+
'name' => 'Fred Peter',
15+
'age' => 18,
16+
'is_active' => 1
17+
],
18+
1 => [
19+
'id' => 2,
20+
'name' => 'Cli Patton',
21+
'age' => 25,
22+
'is_active' => 0
23+
]
24+
];
25+
26+
$changeArrayKeys = Str::changeKeysFromArray(
27+
$arrayCollection,
28+
'is_active',
29+
'active'
30+
);
31+
32+
$removeArrayKeys = Str::removeKeysFromArray(
33+
$arrayCollection,
34+
['is_active', 'id']
35+
);
36+
37+
38+
dd(
39+
$changeArrayKeys,
40+
$removeArrayKeys,
41+
42+
Str::snake('Peterso More'),
43+
Str::camel('peterson more'),
44+
Str::studly('peterson more'),
45+
Str::kebab('Peterson More'),
46+
Str::slug('Peterson More'),
47+
Str::slugify('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 'cn'),
48+
Str::random(),
49+
Str::uuid(),
50+
Str::randomWords(10),
51+
Str::mask('[email protected]', 4),
52+
Str::shorten('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 20),
53+
Str::html('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'),
54+
Str::text('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'),
55+
Str::hash('hoping for more'),
56+
Str::phone('+234 (90) 012-234'),
57+
Str::phone('+234 (90) 012-234', false),
58+
);
59+

UrlHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ static public function path($path = null)
106106
*/
107107
static public function isIpAccessedVia127Port()
108108
{
109-
return Str::contains($_SERVER['REMOTE_ADDR'], self::host());
109+
return Str::contains(
110+
$_SERVER['REMOTE_ADDR'] ?? '',
111+
self::host()
112+
);
110113
}
111114

112115
/**

0 commit comments

Comments
 (0)