src/Console/CommandTrait.php
public function getApplication(): ?Application
    {
        if ($this instanceof Application) {
            return $this;
        }

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

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

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

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

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