protected function console()
    {
        $files = glob($this->getCommandPath() . '/*.php');

        $path = strlen($this->getCommandPath() . DIRECTORY_SEPARATOR);

        $pattern = '/\\.[^.\\s]{3,4}$/';

        foreach ((array) $files as $file) {
            $class = preg_replace($pattern, '', substr($file, $path));

            $class = $this->getCommandNamespace() . '\\' . $class;

            $reflection = new \ReflectionClass($class);

            if (! $reflection->isAbstract()) {
                $this->console->add($this->injector->make($class));
            }
        }

        return $this->console;
    }
protected function console()
    {
        $files = glob($this->getCommandPath() . '/*.php');

        $path = strlen($this->getCommandPath() . DIRECTORY_SEPARATOR);

        $pattern = '/\\.[^.\\s]{3,4}$/';

        foreach ((array) $files as $file) {
            $class = preg_replace($pattern, '', substr($file, $path));

            $class = $this->getCommandNamespace() . '\\' . $class;

            $reflection = new \ReflectionClass($class);

            if (! $reflection->isAbstract()) {
                $this->console->add($this->injector->make($class));
            }
        }

        return $this->console;
    }
protected function console ( ) { $ files = glob ( $ this -> getCommandPath ( ) . '/*.php' ) ; $ path = strlen ( $ this -> getCommandPath ( ) . DIRECTORY_SEPARATOR ) ; $ pattern = '/\\.[^.\\s]{3,4}$/' ; foreach ( ( array ) $ files as $ file ) { $ class = preg_replace ( $ pattern , '' , substr ( $ file , $ path ) ) ; $ class = $ this -> getCommandNamespace ( ) . '\\' . $ class ; $ reflection = new \ ReflectionClass ( $ class ) ; if ( ! $ reflection -> isAbstract ( ) ) { $ this -> console -> add ( $ this -> injector -> make ( $ class ) ) ; } } return $ this -> console ; }
Sets up Twig and gets all commands from the specified path.

@return \Symfony\Component\Console\Application
Sets up Twig and gets all commands from the specified path .