public function getFileUrl(): string
    {
        $version = $this->getVersion();
        Assert::that($version, 'Invalid version (expected format is X.Y.Z)')
            ->notEmpty()
            ->regex('/^\d+\.\d+\.[\da-z\-]+$/i');

        $versionParts = explode('.', $version);

        $devVersion = '';
        if (preg_match('/(\d+)-([[:alnum:]]+)/', $versionParts[2], $matches)) {
            $devVersion = $matches[2];
        }

        $fileUrl = self::$storageUrl . '/' . $versionParts[0] . '.' . $versionParts[1]
            . (!empty($devVersion) ? '-' . $devVersion : '')
            . '/' . $this->getFileName();

        return $fileUrl;
    }
public function getFileUrl(): string
    {
        $version = $this->getVersion();
        Assert::that($version, 'Invalid version (expected format is X.Y.Z)')
            ->notEmpty()
            ->regex('/^\d+\.\d+\.[\da-z\-]+$/i');

        $versionParts = explode('.', $version);

        $devVersion = '';
        if (preg_match('/(\d+)-([[:alnum:]]+)/', $versionParts[2], $matches)) {
            $devVersion = $matches[2];
        }

        $fileUrl = self::$storageUrl . '/' . $versionParts[0] . '.' . $versionParts[1]
            . (!empty($devVersion) ? '-' . $devVersion : '')
            . '/' . $this->getFileName();

        return $fileUrl;
    }
public function getFileUrl ( ) : string { $ version = $ this -> getVersion ( ) ; Assert :: that ( $ version , 'Invalid version (expected format is X.Y.Z)' ) -> notEmpty ( ) -> regex ( '/^\d+\.\d+\.[\da-z\-]+$/i' ) ; $ versionParts = explode ( '.' , $ version ) ; $ devVersion = '' ; if ( preg_match ( '/(\d+)-([[:alnum:]]+)/' , $ versionParts [ 2 ] , $ matches ) ) { $ devVersion = $ matches [ 2 ] ; } $ fileUrl = self :: $ storageUrl . '/' . $ versionParts [ 0 ] . '.' . $ versionParts [ 1 ] . ( ! empty ( $ devVersion ) ? '-' . $ devVersion : '' ) . '/' . $ this -> getFileName ( ) ; return $ fileUrl ; }
Get complete URL of the file to download
Get complete URL of the file to download