Skip to content

Commit

Permalink
Use str_* when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Dec 9, 2023
1 parent 5abc930 commit e966d96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion extra/html-extra/HtmlExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function dataUri(string $data, string $mime = null, array $parameters = [
$repr .= ';'.$key.'='.rawurlencode($value);
}

if (0 === strpos($mime, 'text/')) {
if (str_starts_with($mime, 'text/')) {
$repr .= ','.rawurlencode($data);
} else {
$repr .= ';base64,'.base64_encode($data);
Expand Down
2 changes: 1 addition & 1 deletion tests/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function br()

public function is_multi_word($value)
{
return false !== strpos($value, ' ');
return str_contains($value, ' ');
}

public function __call($method, $arguments)
Expand Down

0 comments on commit e966d96

Please sign in to comment.