, * Pádraic Brady * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ function get_last_tag_name(): string { $gitHubToken = getenv('GITHUB_TOKEN'); $headerOption = false === $gitHubToken || '' === $gitHubToken ? '' : "-H \"Authorization: token $gitHubToken\"" ; $lastReleaseEndpointContents = shell_exec( <<tag_name) || false === is_string($contents->tag_name)) { throw new RuntimeException( sprintf( 'No tag name could be found in: %s', $lastReleaseEndpointContents ), 100 ); } if ('' !== $lastRelease = trim($contents->tag_name)) { return $lastRelease; } throw new RuntimeException('Invalid tag name found.'); } function get_composer_root_version(string $lastTagName): string { $tagParts = explode('.', $lastTagName); array_pop($tagParts); $tagParts[] = '99'; return implode('.', $tagParts); }