From dcbdc31ffa83ec82a796bc68dbe5e35f1acba3b1 Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Sun, 4 Jul 2021 19:20:55 +0200 Subject: [PATCH] Leverage str_ends_with added the php80 polyfill to requirements when necessary --- Gitignore.php | 2 +- composer.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gitignore.php b/Gitignore.php index 304aba9e..491f588e 100644 --- a/Gitignore.php +++ b/Gitignore.php @@ -78,6 +78,6 @@ private static function lineToRegex(string $gitignoreLine): string return ($isAbsolute ? '' : '(?:[^/]+/)*') .$regex - .('/' !== substr($gitignoreLine, -1) ? '(?:$|/)' : ''); + .(!str_ends_with($gitignoreLine, '/') ? '(?:$|/)' : ''); } } diff --git a/composer.json b/composer.json index c86ad2cd..5ccd80cd 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ } ], "require": { - "php": ">=7.1.3" + "php": ">=7.1.3", + "symfony/polyfill-php80": "^1.16" }, "autoload": { "psr-4": { "Symfony\\Component\\Finder\\": "" },