src/Console/Command.php
public function getApplication(): ?Application
    {
        if ($this->application) {
            return $this->application;
        }

        if ($p = $this->parent) {
             return $this->application = $p->getApplication();
        }

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

        if ($p = $this->parent) {
             return $this->application = $p->getApplication();
        }

        return null;
    }
public function getApplication ( ) : ? Application { if ( $ this -> application ) { return $ this -> application ; } if ( $ p = $ this -> parent ) { return $ this -> application = $ p -> getApplication ( ) ; } return null ; }
Get the main application object from parents

@return Application|null
Get the main application object from parents