@@ -212,7 +212,7 @@ private function displayGeneralText(SymfonyStyle $io, string $filter = null)
212
212
foreach ($ types as $ index => $ type ) {
213
213
$ items = [];
214
214
foreach ($ this ->twig ->{'get ' .ucfirst ($ type )}() as $ name => $ entity ) {
215
- if (!$ filter || false !== strpos ($ name , $ filter )) {
215
+ if (!$ filter || str_contains ($ name , $ filter )) {
216
216
$ items [$ name ] = $ name .$ this ->getPrettyMetadata ($ type , $ entity , $ decorated );
217
217
}
218
218
}
@@ -246,7 +246,7 @@ private function displayGeneralJson(SymfonyStyle $io, ?string $filter)
246
246
$ data = [];
247
247
foreach ($ types as $ type ) {
248
248
foreach ($ this ->twig ->{'get ' .ucfirst ($ type )}() as $ name => $ entity ) {
249
- if (!$ filter || false !== strpos ($ name , $ filter )) {
249
+ if (!$ filter || str_contains ($ name , $ filter )) {
250
250
$ data [$ type ][$ name ] = $ this ->getMetadata ($ type , $ entity );
251
251
}
252
252
}
@@ -396,7 +396,7 @@ private function findWrongBundleOverrides(): array
396
396
$ folders = glob ($ this ->twigDefaultPath .'/bundles/* ' , \GLOB_ONLYDIR );
397
397
$ relativePath = ltrim (substr ($ this ->twigDefaultPath .'/bundles/ ' , \strlen ($ this ->projectDir )), \DIRECTORY_SEPARATOR );
398
398
$ bundleNames = array_reduce ($ folders , function ($ carry , $ absolutePath ) use ($ relativePath ) {
399
- if (0 === strpos ($ absolutePath , $ this ->projectDir )) {
399
+ if (str_starts_with ($ absolutePath , $ this ->projectDir )) {
400
400
$ name = basename ($ absolutePath );
401
401
$ path = ltrim ($ relativePath .$ name , \DIRECTORY_SEPARATOR );
402
402
$ carry [$ name ] = $ path ;
@@ -526,7 +526,7 @@ private function findAlternatives(string $name, array $collection): array
526
526
$ alternatives = [];
527
527
foreach ($ collection as $ item ) {
528
528
$ lev = levenshtein ($ name , $ item );
529
- if ($ lev <= \strlen ($ name ) / 3 || false !== strpos ($ item , $ name )) {
529
+ if ($ lev <= \strlen ($ name ) / 3 || str_contains ($ item , $ name )) {
530
530
$ alternatives [$ item ] = isset ($ alternatives [$ item ]) ? $ alternatives [$ item ] - $ lev : $ lev ;
531
531
}
532
532
}
@@ -540,7 +540,7 @@ private function findAlternatives(string $name, array $collection): array
540
540
541
541
private function getRelativePath (string $ path ): string
542
542
{
543
- if (null !== $ this ->projectDir && 0 === strpos ($ path , $ this ->projectDir )) {
543
+ if (null !== $ this ->projectDir && str_starts_with ($ path , $ this ->projectDir )) {
544
544
return ltrim (substr ($ path , \strlen ($ this ->projectDir )), \DIRECTORY_SEPARATOR );
545
545
}
546
546
0 commit comments