src/PortaText/Command/Factory.php
public function get($command)
    {
        $className = ucfirst($command);
        $className = "PortaText\\Command\\Api\\$className";
        if (!class_exists($className)) {
            throw new \InvalidArgumentException(
                "Command $command does not exist"
            );
        }
        return new $className();
    }
public function get($command)
    {
        $className = ucfirst($command);
        $className = "PortaText\\Command\\Api\\$className";
        if (!class_exists($className)) {
            throw new \InvalidArgumentException(
                "Command $command does not exist"
            );
        }
        return new $className();
    }
public function get ( $ command ) { $ className = ucfirst ( $ command ) ; $ className = "PortaText\\Command\\Api\\$className" ; if ( ! class_exists ( $ className ) ) { throw new \ InvalidArgumentException ( "Command $command does not exist" ) ; } return new $ className ( ) ; }
Returns a command instance based on the command name requested.

@param string $command The name of the command.

@return PortaText\Command\ICommand
@throws InvalidArgumentException
Returns a command instance based on the command name requested .