Skip to content

Commit 9ffb163

Browse files
vicbfabpot
authored andcommitted
Make use of SplFileInfo::getBasename
1 parent d87c3c5 commit 9ffb163

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Symfony/Component/HttpKernel/Bundle/Bundle.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public function registerExtensions(ContainerBuilder $container)
121121

122122
$prefix = $this->namespacePrefix.'\\'.$this->name.'\\DependencyInjection';
123123
foreach ($finder as $file) {
124-
$class = $prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.basename($file, '.php');
124+
$class = $prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.$file->getBasename('.php');
125125

126126
if ('Extension' === substr($class, -9)) {
127127
$container->registerExtension(new $class());
@@ -150,7 +150,7 @@ public function registerCommands(Application $application)
150150

151151
$prefix = $this->namespacePrefix.'\\'.$this->name.'\\Command';
152152
foreach ($finder as $file) {
153-
$r = new \ReflectionClass($prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.basename($file, '.php'));
153+
$r = new \ReflectionClass($prefix.strtr($file->getPath(), array($dir => '', '/' => '\\')).'\\'.$file->getBasename('.php'));
154154
if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract()) {
155155
$application->add($r->newInstance());
156156
}

0 commit comments

Comments
 (0)