Skip to content

Do not prefix Command Class Name by 'App' if the prefix is 'app:' #205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Maker/MakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,10 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
public function generate(InputInterface $input, ConsoleStyle $io, Generator $generator)
{
$commandName = trim($input->getArgument('name'));
$commandNameHasAppPrefix = 0 === strpos($commandName, 'app:');

$commandClassNameDetails = $generator->createClassNameDetails(
$commandName,
$commandNameHasAppPrefix ? substr($commandName, 4) : $commandName,
'Command\\',
'Command',
sprintf('The "%s" command name is not valid because it would be implemented by "%s" class, which is not valid as a PHP class name (it must start with a letter or underscore, followed by any number of letters, numbers, or underscores).', $commandName, Str::asClassName($commandName, 'Command'))
Expand Down