Skip to content

Commit 11f5bc2

Browse files
Upgrade the versions of phpstan and rector.
Co-authored-by: 李铭昕 <[email protected]>
1 parent 011cc86 commit 11f5bc2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/Str.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ public static function excerpt($text, $phrase = '', $options = [])
10791079
$radius = $options['radius'] ?? 100;
10801080
$omission = $options['omission'] ?? '...';
10811081

1082-
preg_match('/^(.*?)(' . preg_quote((string) $phrase) . ')(.*)$/iu', (string) $text, $matches);
1082+
preg_match('/^(.*?)(' . preg_quote((string) $phrase, '/') . ')(.*)$/iu', (string) $text, $matches);
10831083

10841084
if (empty($matches)) {
10851085
return null;

tests/StrTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,6 @@ public function testValidUrls($url)
431431
$this->assertTrue(Str::isUrl($url));
432432
}
433433

434-
#[DataProvider('invalidUrls')]
435-
public function testInvalidUrls($url)
436-
{
437-
$this->assertFalse(Str::isUrl($url));
438-
}
439-
440434
public static function validUrls()
441435
{
442436
return [
@@ -679,6 +673,12 @@ public static function validUrls()
679673
];
680674
}
681675

676+
#[DataProvider('invalidUrls')]
677+
public function testInvalidUrls($url)
678+
{
679+
$this->assertFalse(Str::isUrl($url));
680+
}
681+
682682
public static function invalidUrls()
683683
{
684684
return [

0 commit comments

Comments
 (0)