Site/OptionalSite.php
public function getOriginalSite()
    {
        if ($site = $this->siteSelectorInterface->retrieve()) {
            return $site;
        }

        $sites = $this->getSites();

        if ($site = $this->getDefaultSite($sites)) {
            return $site;
        }

        if (count($sites) == 1) {
            return $sites[0];
        }

        throw new SiteNotFoundException(sprintf("Can't find any site in the system."));
    }
public function getOriginalSite()
    {
        if ($site = $this->siteSelectorInterface->retrieve()) {
            return $site;
        }

        $sites = $this->getSites();

        if ($site = $this->getDefaultSite($sites)) {
            return $site;
        }

        if (count($sites) == 1) {
            return $sites[0];
        }

        throw new SiteNotFoundException(sprintf("Can't find any site in the system."));
    }
{@inheritdoc}