src/Installer/Updater.php
/**
     * @param string $workshopName
     * @return string The updated version.
     */
@param string $workshopName
@return string The updated version.
@param string $workshopName @return string The updated version .
public function updateWorkshop(string $workshopName): string
    {
        $workshop = $this->installedWorkshopRepository->getByCode($workshopName);
        $latestRelease = $this->versionChecker->getLatestRelease($workshop);
        if ($latestRelease->getTag() === $workshop->getVersion()) {
            throw new NoUpdateAvailableException();
        }
        $this->uninstaller->uninstallWorkshop($workshopName);
        $this->installer->installWorkshop($workshopName);
        return $latestRelease->getTag();
    }
public function updateWorkshop ( string $ workshopName ) : string { $ workshop = $ this -> installedWorkshopRepository -> getByCode ( $ workshopName ) ; $ latestRelease = $ this -> versionChecker -> getLatestRelease ( $ workshop ) ; if ( $ latestRelease -> getTag ( ) === $ workshop -> getVersion ( ) ) { throw new NoUpdateAvailableException ( ) ; } $ this -> uninstaller -> uninstallWorkshop ( $ workshopName ) ; $ this -> installer -> installWorkshop ( $ workshopName ) ; return $ latestRelease -> getTag ( ) ; }
@param string $workshopName
 @return string The updated version.
@param string $workshopName @return string The updated version .