public function handleAlias(CommandPreRunEvent $event)
    {
        $input = $event->getInput();

        $commandName = $input->getFirstArgument();

        $aliasConfig = $this->configManager->getConfig('alias');

        if (!isset($aliasConfig[$commandName])) {
            return;
        }

        $command = $aliasConfig[$commandName];
        $command = $command .= substr($input->getRawCommand(), strlen($commandName));

        $newInput = new StringInput($command);
        $event->setInput($newInput);

        return $command;
    }
public function handleAlias(CommandPreRunEvent $event)
    {
        $input = $event->getInput();

        $commandName = $input->getFirstArgument();

        $aliasConfig = $this->configManager->getConfig('alias');

        if (!isset($aliasConfig[$commandName])) {
            return;
        }

        $command = $aliasConfig[$commandName];
        $command = $command .= substr($input->getRawCommand(), strlen($commandName));

        $newInput = new StringInput($command);
        $event->setInput($newInput);

        return $command;
    }
public function handleAlias ( CommandPreRunEvent $ event ) { $ input = $ event -> getInput ( ) ; $ commandName = $ input -> getFirstArgument ( ) ; $ aliasConfig = $ this -> configManager -> getConfig ( 'alias' ) ; if ( ! isset ( $ aliasConfig [ $ commandName ] ) ) { return ; } $ command = $ aliasConfig [ $ commandName ] ; $ command = $ command .= substr ( $ input -> getRawCommand ( ) , strlen ( $ commandName ) ) ; $ newInput = new StringInput ( $ command ) ; $ event -> setInput ( $ newInput ) ; return $ command ; }
Check for an alias and replace the input with a new string command
if the alias exists.

@return string New command string (for testing purposes)
Check for an alias and replace the input with a new string command if the alias exists .