Skip to content

Commit 1cc7935

Browse files
committed
Leverage str_ends_with
added the php80 polyfill to requirements when necessary
1 parent c3557b6 commit 1cc7935

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Command/AbstractConfigCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected function findExtension($name)
9696
}
9797
}
9898

99-
if ('Bundle' !== substr($name, -6)) {
99+
if (!str_ends_with($name, 'Bundle')) {
100100
$message = sprintf('No extensions with configuration available for "%s".', $name);
101101
} else {
102102
$message = sprintf('No extension with alias "%s" is enabled.', $name);

Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8181
$realCacheDir = $kernel->getContainer()->getParameter('kernel.cache_dir');
8282
// the old cache dir name must not be longer than the real one to avoid exceeding
8383
// the maximum length of a directory or file path within it (esp. Windows MAX_PATH)
84-
$oldCacheDir = substr($realCacheDir, 0, -1).('~' === substr($realCacheDir, -1) ? '+' : '~');
84+
$oldCacheDir = substr($realCacheDir, 0, -1).(str_ends_with($realCacheDir, '~') ? '+' : '~');
8585
$fs->remove($oldCacheDir);
8686

8787
if (!is_writable($realCacheDir)) {

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"symfony/http-foundation": "^4.4|^5.0",
2626
"symfony/http-kernel": "^4.4",
2727
"symfony/polyfill-mbstring": "~1.0",
28+
"symfony/polyfill-php80": "^1.16",
2829
"symfony/filesystem": "^3.4|^4.0|^5.0",
2930
"symfony/finder": "^3.4|^4.0|^5.0",
3031
"symfony/routing": "^4.4.12|^5.1.4"

0 commit comments

Comments
 (0)