Skip to content

Commit

Permalink
Leverage str_ends_with
Browse files Browse the repository at this point in the history
added the php80 polyfill to requirements when necessary
  • Loading branch information
Tobion committed Jul 21, 2021
1 parent f638807 commit dcbdc31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Gitignore.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ private static function lineToRegex(string $gitignoreLine): string

return ($isAbsolute ? '' : '(?:[^/]+/)*')
.$regex
.('/' !== substr($gitignoreLine, -1) ? '(?:$|/)' : '');
.(!str_ends_with($gitignoreLine, '/') ? '(?:$|/)' : '');
}
}
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
}
],
"require": {
"php": ">=7.1.3"
"php": ">=7.1.3",
"symfony/polyfill-php80": "^1.16"
},
"autoload": {
"psr-4": { "Symfony\\Component\\Finder\\": "" },
Expand Down

0 comments on commit dcbdc31

Please sign in to comment.