getUnreleasedDir example

if (!$dryRun) {
            $this->filesystem->mkdir($releaseDir);
            $output[] = '* Move the unreleased changelog files to release folder: ' . $releaseDir;
        } else {
            $output[] = '---';
            $output[] = 'Move the unreleased changelog files to release folder: ' . $releaseDir;
            $output[] = '---';
        }

        foreach ($collection as $changelog) {
            if (!$dryRun) {
                $this->filesystem->rename($this->getUnreleasedDir() . '/' . $changelog->getName()$releaseDir . '/' . $changelog->getName());
            } else {
                $output[] = '* ' . $changelog->getName();
            }
        }

        return $output;
    }

    /** * Update the CHANGELOG.md global file * * @param list<string> $output * * @return list<string> */
 else {
            file_put_contents($target$template->toTemplate());
        }

        return $target;
    }

    private function getTemplateFile(ChangelogDefinition $template, string $date): string
    {
        return sprintf(
            '%s/%s-%s.md',
            $this->getUnreleasedDir(),
            $date,
            $this->replaceSpecialChars($template->getTitle())
        );
    }

    private function replaceSpecialChars(string $name): string
    {
        $name = (string) preg_replace('/[^a-z_\-0-9]/i', '-', $name);
        $name = (string) preg_replace('/[-]{2,}/', '-', $name);
        $name = (string) preg_replace('/[-_]+$/', '', $name);
        $name = (string) preg_replace('/^[-_]+/', '', $name);

        
return $errors;
    }

    /** * @return list<string> */
    private function getUnreleasedChangelogFiles(): array
    {
        $entries = [];
        $finder = new Finder();
        $finder->in($this->getUnreleasedDir())->files()->sortByName()->depth('0')->name('*.md');
        if ($finder->hasResults()) {
            foreach ($finder as $file) {
                $entries[] = (string) $file->getRealPath();
            }
        }

        return $entries;
    }
}
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');
        if ($finder->hasResults()) {
            foreach ($finder as $file) {
                $definition = $this->parser->parse($file->getContents());

                $issues = $this->validator->validate($definition);
                if ($issues->count()) {
                    $messages = \array_map(static fn (ConstraintViolationInterface $violation) => $violation->getMessage(), \iterator_to_array($issues));

                    throw new \InvalidArgumentException(\sprintf('Invalid file at path: %s, errors: %s', $file->getRealPath(), \implode(', ', $messages)));
                }

                
Home | Imprint | This part of the site doesn't use cookies.