private function getDefaultExtFromSite($pathinfo, $extension = null, Site $site = null)
    {
        if (strpos(basename($pathinfo), '.') || '/' === substr($pathinfo, -1)) {
            return $pathinfo;
        }

        $siteUsed = $this->getCurrentSite($site);
        $addExtension = $extension;
        if (null === $addExtension && null !== $siteUsed) {
            $addExtension = $siteUsed->getDefaultExtension();
        }

        return $pathinfo.$addExtension;
    }
private function getDefaultExtFromSite($pathinfo, $extension = null, Site $site = null)
    {
        if (strpos(basename($pathinfo), '.') || '/' === substr($pathinfo, -1)) {
            return $pathinfo;
        }

        $siteUsed = $this->getCurrentSite($site);
        $addExtension = $extension;
        if (null === $addExtension && null !== $siteUsed) {
            $addExtension = $siteUsed->getDefaultExtension();
        }

        return $pathinfo.$addExtension;
    }
private function getDefaultExtFromSite ( $ pathinfo , $ extension = null , Site $ site = null ) { if ( strpos ( basename ( $ pathinfo ) , '.' ) || '/' === substr ( $ pathinfo , - 1 ) ) { return $ pathinfo ; } $ siteUsed = $ this -> getCurrentSite ( $ site ) ; $ addExtension = $ extension ; if ( null === $ addExtension && null !== $ siteUsed ) { $ addExtension = $ siteUsed -> getDefaultExtension ( ) ; } return $ pathinfo . $ addExtension ; }
Adds the extension provided, pr the default one for a site.

@param  string      $pathinfo  The pathinfo to change.
@param  string|null $extension Optional, the extention to add.
@param  Site|null   $site      Optional, the site from which the default extension will be got.

@return string                 The pathinfo with the extension added.
Adds the extension provided pr the default one for a site .