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

Skip to content

Commit 3762b20

Browse files
Remove trailing directory separator for namespace
The namespace created by the Command was incorrect as the trailing / was not removed.
1 parent 2b2c250 commit 3762b20

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Command/MakeCrudControllerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6161

6262
$guessedNamespace = u($controllerDir)->equalsTo('src')
6363
? 'App'
64-
: u($controllerDir)->replace('/', ' ')->replace('\\', ' ')->replace('src ', 'app ')->title(true)->replace(' ', '\\');
64+
: u($controllerDir)->replace('/', ' ')->replace('\\', ' ')->replace('src ', 'app ')->title(true)->replace(' ', '\\')->trimEnd(DIRECTORY_SEPARATOR);
6565
$namespace = $io->ask('Namespace of the generated CRUD controller', $guessedNamespace, static function(string $namespace) {
6666
return u($namespace)->replace('/', '\\')->toString();
6767
});

0 commit comments

Comments
 (0)