public function getApplication(): Application
    {
        if (!empty($this->application)) {
            return $this->application;
        }

        $this->application = new Application($this->config->getName(), $this->config->getVersion());
        $this->application->setCatchExceptions(false);
        $this->application->setAutoExit(false);

        if (!is_null($this->locator)) {
            foreach ($this->locator->locateCommands() as $command) {
                $this->application->add($command);
            }
        }

        // Register user defined commands
        $static = new StaticLocator($this->config->getCommands(), $this->container);
        foreach ($static->locateCommands() as $command) {
            $this->application->add($command);
        }

        return $this->application;
    }
public function getApplication(): Application
    {
        if (!empty($this->application)) {
            return $this->application;
        }

        $this->application = new Application($this->config->getName(), $this->config->getVersion());
        $this->application->setCatchExceptions(false);
        $this->application->setAutoExit(false);

        if (!is_null($this->locator)) {
            foreach ($this->locator->locateCommands() as $command) {
                $this->application->add($command);
            }
        }

        // Register user defined commands
        $static = new StaticLocator($this->config->getCommands(), $this->container);
        foreach ($static->locateCommands() as $command) {
            $this->application->add($command);
        }

        return $this->application;
    }
public function getApplication ( ) : Application { if ( ! empty ( $ this -> application ) ) { return $ this -> application ; } $ this -> application = new Application ( $ this -> config -> getName ( ) , $ this -> config -> getVersion ( ) ) ; $ this -> application -> setCatchExceptions ( false ) ; $ this -> application -> setAutoExit ( false ) ; if ( ! is_null ( $ this -> locator ) ) { foreach ( $ this -> locator -> locateCommands ( ) as $ command ) { $ this -> application -> add ( $ command ) ; } } // Register user defined commands $ static = new StaticLocator ( $ this -> config -> getCommands ( ) , $ this -> container ) ; foreach ( $ static -> locateCommands ( ) as $ command ) { $ this -> application -> add ( $ command ) ; } return $ this -> application ; }
Get associated Symfony Console Application.

@return Application

@throws \Spiral\Console\Exception\LocatorException
Get associated Symfony Console Application .