public function discoverCommands()
    {
        $commands = (new PhpClassDiscovery())
            ->addSearchLocation(APP_ROOT . '/src/Command')
            ->matchExtend('Symfony\Component\Console\Command\Command')
            ->discover();

        foreach ($commands as $classname) {
            $this->add(new $classname());
        }

        return $this;
    }
public function discoverCommands()
    {
        $commands = (new PhpClassDiscovery())
            ->addSearchLocation(APP_ROOT . '/src/Command')
            ->matchExtend('Symfony\Component\Console\Command\Command')
            ->discover();

        foreach ($commands as $classname) {
            $this->add(new $classname());
        }

        return $this;
    }
public function discoverCommands ( ) { $ commands = ( new PhpClassDiscovery ( ) ) -> addSearchLocation ( APP_ROOT . '/src/Command' ) -> matchExtend ( 'Symfony\Component\Console\Command\Command' ) -> discover ( ) ; foreach ( $ commands as $ classname ) { $ this -> add ( new $ classname ( ) ) ; } return $ this ; }
Discover Project-X commands.
Discover Project - X commands .