Skip to content

Commit e72a900

Browse files
committed
Leverage str_ends_with
added the php80 polyfill to requirements when necessary
1 parent 2afbda9 commit e72a900

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Formatter/OutputFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public static function escape($text)
5454
*/
5555
public static function escapeTrailingBackslash(string $text): string
5656
{
57-
if ('\\' === substr($text, -1)) {
57+
if (str_ends_with($text, '\\')) {
5858
$len = \strlen($text);
5959
$text = rtrim($text, '\\');
6060
$text = str_replace("\0", '', $text);

Style/SymfonyStyle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ private function autoPrependText(): void
442442
{
443443
$fetched = $this->bufferedOutput->fetch();
444444
//Prepend new line if last char isn't EOL:
445-
if ("\n" !== substr($fetched, -1)) {
445+
if (!str_ends_with($fetched, "\n")) {
446446
$this->newLine();
447447
}
448448
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": ">=7.1.3",
2020
"symfony/polyfill-mbstring": "~1.0",
2121
"symfony/polyfill-php73": "^1.8",
22-
"symfony/polyfill-php80": "^1.15",
22+
"symfony/polyfill-php80": "^1.16",
2323
"symfony/service-contracts": "^1.1|^2"
2424
},
2525
"require-dev": {

0 commit comments

Comments
 (0)