getUpgradeInformation example


    private function releaseUpgradeInformation(
        array $output,
        string $version,
        ChangelogFileCollection $collection,
        bool $dryRun = false
    ): array {
        $append = [];
        foreach ($collection as $changelog) {
            $upgrade = $changelog->getDefinition()->getUpgradeInformation();
            if ($upgrade) {
                $append[] = $upgrade;
            }
        }
        if (!\count($append)) {
            return $output;
        }

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

        $upgradeFile = $this->getTargetUpgradeFile($version);
        
static::assertSame($expectedData['title']$logEntry->getTitle());
        static::assertSame($expectedData['issue']$logEntry->getIssue());
        static::assertSame($expectedData['flag']$logEntry->getFlag());
        static::assertSame($expectedData['author']$logEntry->getAuthor());
        static::assertSame($expectedData['authorEmail']$logEntry->getAuthorEmail());
        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]));
        }

        
$title = ChangelogSection::storefront->value;
                $getContentFnc = static fn (ChangelogDefinition $definition): ?string => $definition->getStorefront();

                break;
            case ChangelogSection::administration->name:
                $title = ChangelogSection::administration->value;
                $getContentFnc = static fn (ChangelogDefinition $definition): ?string => $definition->getAdministration();

                break;
            case ChangelogSection::upgrade->name:
                $title = ChangelogSection::upgrade->value;
                $getContentFnc = static fn (ChangelogDefinition $definition): ?string => $definition->getUpgradeInformation();

                break;
            case ChangelogSection::major->name:
                $title = ChangelogSection::major->value;
                $getContentFnc = static fn (ChangelogDefinition $definition): ?string => $definition->getNextMajorVersionChanges();

                break;
        }
        $changes = [];
        foreach ($collection as $changelog) {
            $content = $getContentFnc($changelog->getDefinition());
            
Home | Imprint | This part of the site doesn't use cookies.