Skip to content

Commit 1972ba9

Browse files
committed
Updated spatie/laravel-html version. Fixed deprecation of using ctype_alnum()
1 parent b563e0e commit 1972ba9

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"php": "^7.3|^8.0",
1515
"illuminate/support": "^8.0",
1616
"symfony/polyfill-mbstring": "^1.0",
17-
"spatie/laravel-html": "^2.27"
17+
"spatie/laravel-html": "^3.0"
1818
},
1919
"require-dev": {
2020
"phpunit/phpunit": "^9.3",

src/Parsers/AbstractParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected function trimDelimeters(Cursor $cursor, int $start, int $end): ?array
3838
} elseif ($character === ';') {
3939
$newEnd = $end - 2;
4040

41-
while ($newEnd > 0 && ctype_alnum($cursor->getCharacter($newEnd))) {
41+
while ($newEnd > 0 && ctype_alnum((string) $cursor->getCharacter($newEnd))) {
4242
$newEnd--;
4343
}
4444

src/Parsers/AbstractUrlParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ abstract class AbstractUrlParser extends AbstractParser
1818
*/
1919
protected function validateDomain(Cursor $cursor, int $start, bool $allowShort = true): bool
2020
{
21-
if (! ctype_alnum($cursor->getCharacter($start))) {
21+
if (! ctype_alnum((string) $cursor->getCharacter($start))) {
2222
return false;
2323
}
2424

2525
$dot = 0;
2626

2727
for ($i = $start + 3, $j = $cursor->getLength() - 1; $i < $j; $i++) {
28-
$character = $cursor->getCharacter($i);
28+
$character = (string) $cursor->getCharacter($i);
2929

3030
if ($character === '.') {
3131
$dot++;

src/Parsers/EmailParser.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function parse(Cursor $cursor): ?Element
3838
$cursor->prev();
3939

4040
while ($cursor->valid()) {
41-
$character = $cursor->getCharacter();
41+
$character = (string) $cursor->getCharacter();
4242

4343
if (ctype_alnum($character) || strpos('.+-_%', $character) !== false) {
4444
$start = $cursor->getPosition();
@@ -65,7 +65,7 @@ public function parse(Cursor $cursor): ?Element
6565
$at = $dot = 0;
6666

6767
while ($cursor->valid()) {
68-
$character = $cursor->getCharacter();
68+
$character = (string) $cursor->getCharacter();
6969

7070
if (ctype_alnum($character)) {
7171
$cursor->next();

src/Parsers/UrlParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function parse(Cursor $cursor): ?Element
6262
$end = $cursor->getPosition();
6363

6464
while ($start > 0) {
65-
if (ctype_alpha($cursor->getCharacter($start - 1))) {
65+
if (ctype_alpha((string) $cursor->getCharacter($start - 1))) {
6666
$start--;
6767

6868
continue;

0 commit comments

Comments
 (0)