Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit beb436a

Browse files
committed
up: fix some error for run in php8.4
1 parent 1f06a0f commit beb436a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

‎.github/workflows/php.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
fail-fast: true
1212
matrix:
13-
php: [8.1, 8.2, 8.3]
13+
php: [8.1, 8.2, 8.3, 8.4]
1414
# os: [ubuntu-latest, macOS-latest] # windows-latest,
1515

1616
steps:

‎composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
}
2121
],
2222
"require": {
23-
"php": ">=8.0",
23+
"php": ">=8.1",
2424
"ext-mbstring": "*"
2525
},
2626
"require-dev": {

‎src/Str/Traits/StringTruncateHelperTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static function after(string $s, string $sub, string $fallback = ''): str
128128
*
129129
* @return bool|string
130130
*/
131-
public static function substr(string $str, int $start, int $length = null, string $encoding = 'utf-8'): bool|string
131+
public static function substr(string $str, int $start, int|null $length = null, string $encoding = 'utf-8'): bool|string
132132
{
133133
if (function_exists('mb_substr')) {
134134
return mb_substr($str, $start, $length ?? self::strlen($str), $encoding);
@@ -147,7 +147,7 @@ public static function substr(string $str, int $start, int $length = null, strin
147147
*
148148
* @return string
149149
*/
150-
public static function utf8SubStr(string $str, int $start = 0, int $length = null): string
150+
public static function utf8SubStr(string $str, int $start = 0, int|null $length = null): string
151151
{
152152
if (empty($str)) {
153153
return '';
@@ -241,7 +241,7 @@ public static function truncate(string $str, int $maxLength, string $suffix = '.
241241
*
242242
* @return string
243243
*/
244-
public static function truncate2(string $str, int $start, int $length = null): string
244+
public static function truncate2(string $str, int $start, ?int $length = null): string
245245
{
246246
if (!$length) {
247247
$length = $start;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /