@@ -212,7 +212,7 @@ private function displayGeneralText(SymfonyStyle $io, string $filter = null)
212212 foreach ($ types as $ index => $ type ) {
213213 $ items = [];
214214 foreach ($ this ->twig ->{'get ' .ucfirst ($ type )}() as $ name => $ entity ) {
215- if (!$ filter || false !== strpos ($ name , $ filter )) {
215+ if (!$ filter || str_contains ($ name , $ filter )) {
216216 $ items [$ name ] = $ name .$ this ->getPrettyMetadata ($ type , $ entity , $ decorated );
217217 }
218218 }
@@ -246,7 +246,7 @@ private function displayGeneralJson(SymfonyStyle $io, ?string $filter)
246246 $ data = [];
247247 foreach ($ types as $ type ) {
248248 foreach ($ this ->twig ->{'get ' .ucfirst ($ type )}() as $ name => $ entity ) {
249- if (!$ filter || false !== strpos ($ name , $ filter )) {
249+ if (!$ filter || str_contains ($ name , $ filter )) {
250250 $ data [$ type ][$ name ] = $ this ->getMetadata ($ type , $ entity );
251251 }
252252 }
@@ -396,7 +396,7 @@ private function findWrongBundleOverrides(): array
396396 $ folders = glob ($ this ->twigDefaultPath .'/bundles/* ' , \GLOB_ONLYDIR );
397397 $ relativePath = ltrim (substr ($ this ->twigDefaultPath .'/bundles/ ' , \strlen ($ this ->projectDir )), \DIRECTORY_SEPARATOR );
398398 $ bundleNames = array_reduce ($ folders , function ($ carry , $ absolutePath ) use ($ relativePath ) {
399- if (0 === strpos ($ absolutePath , $ this ->projectDir )) {
399+ if (str_starts_with ($ absolutePath , $ this ->projectDir )) {
400400 $ name = basename ($ absolutePath );
401401 $ path = ltrim ($ relativePath .$ name , \DIRECTORY_SEPARATOR );
402402 $ carry [$ name ] = $ path ;
@@ -526,7 +526,7 @@ private function findAlternatives(string $name, array $collection): array
526526 $ alternatives = [];
527527 foreach ($ collection as $ item ) {
528528 $ lev = levenshtein ($ name , $ item );
529- if ($ lev <= \strlen ($ name ) / 3 || false !== strpos ($ item , $ name )) {
529+ if ($ lev <= \strlen ($ name ) / 3 || str_contains ($ item , $ name )) {
530530 $ alternatives [$ item ] = isset ($ alternatives [$ item ]) ? $ alternatives [$ item ] - $ lev : $ lev ;
531531 }
532532 }
@@ -540,7 +540,7 @@ private function findAlternatives(string $name, array $collection): array
540540
541541 private function getRelativePath (string $ path ): string
542542 {
543- if (null !== $ this ->projectDir && 0 === strpos ($ path , $ this ->projectDir )) {
543+ if (null !== $ this ->projectDir && str_starts_with ($ path , $ this ->projectDir )) {
544544 return ltrim (substr ($ path , \strlen ($ this ->projectDir )), \DIRECTORY_SEPARATOR );
545545 }
546546
0 commit comments