toTemplate example

static::assertSame($expectedData['authorGithub']$logEntry->getAuthorGitHub());
        static::assertSame($expectedData['core']$logEntry->getCore());
        static::assertSame($expectedData['storefront']$logEntry->getStorefront());
        static::assertSame($expectedData['admin']$logEntry->getAdministration());
        static::assertSame($expectedData['api']$logEntry->getApi());
        static::assertSame($expectedData['upgrade']$logEntry->getUpgradeInformation());
        static::assertSame($expectedData['major']$logEntry->getNextMajorVersionChanges());
        $lines = file($outFile);
        static::assertIsArray($lines);

        /** @var array<string> $templateLines */
        $templateLines = explode(\PHP_EOL, $logEntry->toTemplate());

        foreach ($lines as $index => $line) {
            static::assertSame(trim($line)trim($templateLines[$index]));
        }

        $result = self::getContainer()->get(ValidatorInterface::class)->validate($logEntry);

        static::assertCount($expectedExceptions$result);
    }
}
/** * @internal */
#[Package('core')] class ChangelogGenerator extends ChangelogProcessor
{
    public function generate(ChangelogDefinition $template, string $date, bool $dryRun = false): string
    {
        $target = $this->getTemplateFile($template$date);
        if ($dryRun) {
            echo $template->toTemplate();
        } else {
            file_put_contents($target$template->toTemplate());
        }

        return $target;
    }

    private function getTemplateFile(ChangelogDefinition $template, string $date): string
    {
        return sprintf(
            '%s/%s-%s.md',
            
Home | Imprint | This part of the site doesn't use cookies.