TYPO3 v15 dev-main snapshot ()

This commit is contained in:
2026-08-10 22:31:00 +02:00
commit f9941541b7
1178 changed files with 135377 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Backend\Wizard\DTO;
/**
* DTO for wizard configuration holding all steps.
* Used in WizardProviderInterface::getConfiguration() when dynamically loading wizard steps.
*
* @internal
*/
final readonly class Configuration implements \JsonSerializable
{
/**
* @param Step[] $steps
*/
private function __construct(private array $steps)
{
foreach ($steps as $step) {
if (!$step instanceof Step) {
throw new \InvalidArgumentException(
sprintf(
'All elements of $steps must be instances of WizardStepDTO, got %s',
get_debug_type($step)
),
1772114103
);
}
}
}
/**
* @return Step[]
*/
public function getSteps(): array
{
return $this->steps;
}
/**
* @param Step[] $steps
* @return self
*/
public static function create(array $steps): self
{
return new self($steps);
}
public function jsonSerialize(): mixed
{
return [
'steps' => array_map(fn(Step $step) => $step->jsonSerialize(), $this->steps),
];
}
}
+106
View File
@@ -0,0 +1,106 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Backend\Wizard\DTO;
/**
* DTO for a wizard finisher, representing the action after submitting wizard data.
* Used in WizardProviderInterface::handleSubmit() when handling wizard submit.
*
* @internal
*/
final readonly class Finisher implements \JsonSerializable
{
private function __construct(
private string $identifier,
private string $module,
private string $successTitle,
private string $successMessage,
private array $data = []
) {}
public function withResetButton(string $resetButtonLabel): self
{
$newData = $this->data;
$newData['resetButtonTitle'] = $resetButtonLabel;
// Return a new instance with the updated data
return new self(
identifier: $this->identifier,
module: $this->module,
successTitle: $this->successTitle,
successMessage: $this->successMessage,
data: $newData
);
}
public function jsonSerialize(): mixed
{
return [
'identifier' => $this->identifier,
'module' => $this->module,
'data' => $this->data,
'labels' => [
'successTitle' => $this->successTitle,
'successDescription' => $this->successMessage,
],
];
}
public static function createRedirectFinisher(string $url, string $successTitle, string $successMessage): self
{
return new self(
identifier: 'redirect',
module: '@typo3/backend/wizard/finisher/redirect-finisher.js',
successTitle: $successTitle,
successMessage: $successMessage,
data: [
'url' => $url,
]
);
}
public static function createNoopFinisher(string $successTitle, string $successMessage): self
{
return new self(
identifier: 'noop',
module: '@typo3/backend/wizard/finisher/noop-finisher.js',
successTitle: $successTitle,
successMessage: $successMessage,
);
}
public static function createReloadFinisher(string $successTitle, string $successMessage): self
{
return new self(
identifier: 'reload',
module: '@typo3/backend/wizard/finisher/reload-finisher.js',
successTitle: $successTitle,
successMessage: $successMessage,
);
}
public static function createCustomFinisher(
string $identifier,
string $module,
string $successTitle,
string $successMessage,
array $data = []
): self {
return new self($identifier, $module, $successTitle, $successMessage, $data);
}
}
+52
View File
@@ -0,0 +1,52 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Backend\Wizard\DTO;
/**
* DTO for a single wizard step with module and configuration data.
* Used in WizardProviderInterface::getConfiguration() when dynamically loading wizard steps.
*
* @internal
*/
final class Step implements \JsonSerializable
{
private array $configurationData = [];
private function __construct(private readonly string $module) {}
public function jsonSerialize(): mixed
{
return [
'module' => $this->module,
'configurationData' => $this->configurationData,
];
}
public static function create(string $module): self
{
return new self($module);
}
public function withConfigurationData(array $configurationData): self
{
$new = clone $this;
$new->configurationData = $configurationData;
return $new;
}
}
+70
View File
@@ -0,0 +1,70 @@
<?php
declare(strict_types=1);
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
namespace TYPO3\CMS\Backend\Wizard\DTO;
/**
* DTO for the result of submitting wizard data, including success state, errors, and optional finisher.
* Used in WizardProviderInterface::handleSubmit() when returning the outcome of a wizard submission.
*
* @internal
*/
final readonly class SubmissionResult implements \JsonSerializable
{
private function __construct(
private bool $success = true,
private ?Finisher $finisher = null,
private array $errors = []
) {}
public function jsonSerialize(): mixed
{
$data = [
'success' => $this->success,
];
if ($this->finisher !== null) {
$data['finisher'] = $this->finisher->jsonSerialize();
}
if (!empty($this->errors)) {
$data['errors'] = $this->errors;
}
return $data;
}
public static function createSuccessResult(
Finisher $finisher
): self {
return new self(
success: true,
finisher: $finisher
);
}
/**
* @param string[] $errors
*/
public static function createErrorResult(array $errors): self
{
return new self(
success: false,
errors: $errors
);
}
}