Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e248e2

Browse files
committed
simplify
1 parent 411b14e commit 1e248e2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/Symfony/Bundle/FrameworkBundle/Kernel/MicroKernelTrait.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,12 @@ private function configureRoutes(RoutingConfigurator $routes): void
8383
$routes->import($configDir.'/{routes}.php');
8484
}
8585

86-
$reflectionClass = new \ReflectionClass(static::class);
87-
do {
88-
if ((!$fileName = $reflectionClass->getFileName()) || !is_file($fileName)) {
89-
continue;
90-
}
91-
86+
if (
87+
false !== ($fileName = (new \ReflectionClass(static::class))->getFileName()) &&
88+
is_file($fileName)
89+
) {
9290
$routes->import($fileName, 'annotation');
93-
94-
$reflectionClass = $reflectionClass->getParentClass();
95-
} while ($reflectionClass);
91+
}
9692
}
9793

9894
/**

0 commit comments

Comments
 (0)