getNextMajorVersion example

$append = [];
        foreach ($collection as $changelog) {
            $upgrade = $changelog->getDefinition()->getNextMajorVersionChanges();
            if ($upgrade) {
                $append[] = $upgrade;
            }
        }
        if (!\count($append)) {
            return $output;
        }

        $nextMajorVersionHeadline = '# ' . $this->getNextMajorVersion($version) . '.0.0' . \PHP_EOL;

        array_unshift($appendsprintf('## Introduced in %s', $version));

        $upgradeFile = $this->getTargetNextMajorUpgradeFile($version);
        if (!$dryRun) {
            if (!$this->filesystem->exists($upgradeFile)) {
                $this->filesystem->touch($upgradeFile);
            }

            $content = file_get_contents($upgradeFile) ?: '';

            
protected function getTargetUpgradeFile(string $version, bool $realPath = true): string
    {
        return ($realPath ? $this->getUpgradeDir() . '/' : '') . \sprintf('UPGRADE-%s.md', $this->getMajorVersion($version));
    }

    /** * @internal */
    protected function getTargetNextMajorUpgradeFile(string $version, bool $realPath = true): string
    {
        return ($realPath ? $this->getUpgradeDir() . '/' : '') . \sprintf('UPGRADE-%s.md', $this->getNextMajorVersion($version));
    }

    /** * Prepare the list of changelog files which need to process */
    protected function prepareChangelogFiles(?string $version = null, bool $includeFeatureFlags = false): ChangelogFileCollection
    {
        $entries = new ChangelogFileCollection();

        $finder = new Finder();
        $finder->in($version ? $this->getTargetReleaseDir($version) : $this->getUnreleasedDir())->files()->sortByName()->depth('0')->name('*.md');
        
Home | Imprint | This part of the site doesn't use cookies.