private function getCurrentSite(Site $site = null)
    {
        if (null !== $site) {
            return $site;
        }

        if (null !== $this->application) {
            return $this->application->getSite();
        }

        return null;
    }
private function getCurrentSite(Site $site = null)
    {
        if (null !== $site) {
            return $site;
        }

        if (null !== $this->application) {
            return $this->application->getSite();
        }

        return null;
    }
private function getCurrentSite ( Site $ site = null ) { if ( null !== $ site ) { return $ site ; } if ( null !== $ this -> application ) { return $ this -> application -> getSite ( ) ; } return null ; }
Returns the current site if defined.

@param  Site|null $site Optional, if provided, will be return.

@return Site|null
Returns the current site if defined .