diff --git a/README.md b/README.md index 2c67cc3..25be3b6 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,7 @@ as well for this commit and pushed to git (ensure that you have rights to add ta [version] can be either "11.5.3" or "11.5" for detecting the branch and the next version (of no specific version is set) - --sprint-release If this option is set, the version is considered as sprint release (e.g. 9.1.0) - --commitMessage -m An additional information to the commit message of the release commit. + --sprint-release If this option is set, the version is considered as sprint release (e.g. 9.1.0) - don't use this for an LTS (e.g. 14.3.0) release --interactive -i Enabled by default, to verify that the right version and branch is used. --dry-run No push to the remote git repository and gerrit is done, making all changes only in the local repository. diff --git a/src/Command/ReleaseCommand.php b/src/Command/ReleaseCommand.php index 75c8c61..3c02299 100644 --- a/src/Command/ReleaseCommand.php +++ b/src/Command/ReleaseCommand.php @@ -45,12 +45,6 @@ public function configure(): void InputArgument::REQUIRED, 'Set it to "8.7" to release the next "8.7.x" version (even if "8.7.0" has not been released). Checks for a branch named like TYPO3_8-7 or uses main' ) - ->addOption( - 'commitMessage', - 'm', - InputOption::VALUE_OPTIONAL, - 'Additional commit message to [RELEASE] Release of TYPO3 x.y.z' - ) ->addOption( 'sprint-release', null, @@ -129,9 +123,6 @@ public function execute(InputInterface $input, OutputInterface $output): int // Now commit with "[RELEASE] Released TYPO3 x.y.z" $commitMessage = '[RELEASE] Release of TYPO3 ' . $nextVersion; - if ($input->hasOption('commitMessage') && $input->getOption('commitMessage')) { - $commitMessage .= "\n\n" . $input->getOption('commitMessage'); - } $git->run('commit', ['-a', '-S', '--allow-empty', '-m', trim($commitMessage)]); $localReleaseCommitHash = $this->gitHelper->getCurrentRevision(); $this->io->success('Release commit is ' . $localReleaseCommitHash . ' with message ' . "\n\n" . $commitMessage); diff --git a/src/Model/AnnounceApi/HashCollection.php b/src/Model/AnnounceApi/HashCollection.php index ee05e9a..1982166 100644 --- a/src/Model/AnnounceApi/HashCollection.php +++ b/src/Model/AnnounceApi/HashCollection.php @@ -19,9 +19,6 @@ class HashCollection extends \ArrayObject implements \JsonSerializable 'sha256sum' => 64, ]; - /** - * @param array $hashes - */ public function __construct(array $hashes) { $hashes = array_intersect_key( @@ -52,9 +49,6 @@ public function __construct(array $hashes) parent::__construct($hashes); } - /** - * @return array - */ public function jsonSerialize(): array { return $this->getArrayCopy(); diff --git a/src/Model/AnnounceApi/Release.php b/src/Model/AnnounceApi/Release.php index af003c2..167db20 100644 --- a/src/Model/AnnounceApi/Release.php +++ b/src/Model/AnnounceApi/Release.php @@ -13,62 +13,18 @@ class Release implements \JsonSerializable { - /** - * @var string - */ - private $version; - - /** - * @var string - */ - private $type; - - /** - * @var \DateTimeInterface - */ - private $date; - - /** - * @var HashCollection - */ - private $tarPackage; - - /** - * @var HashCollection - */ - private $zipPackage; - - /** - * @var ReleaseNotes - */ - private $releaseNotes; - - /** - * @var bool - */ - private $elts; - public function __construct( - string $version, - string $type, - \DateTimeInterface $date, - HashCollection $tarPackage, - HashCollection $zipPackage, - ReleaseNotes $releaseNotes = null, - bool $elts = false + private string $version, + private string $type, + private \DateTimeInterface $date, + private HashCollection $tarPackage, + private HashCollection $zipPackage, + private ?ReleaseNotes $releaseNotes = null, + private bool $elts = false ) { - $this->version = $version; - $this->type = $type; - $this->date = $date; - $this->tarPackage = $tarPackage; - $this->zipPackage = $zipPackage; - $this->releaseNotes = $releaseNotes; - $this->elts = $elts; + } - /** - * @return array - */ public function jsonSerialize(): array { $result = [ @@ -85,33 +41,21 @@ public function jsonSerialize(): array return $result; } - /** - * @return string - */ public function getVersion(): string { return $this->version; } - /** - * @return string - */ public function getType(): string { return $this->type; } - /** - * @return \DateTimeInterface - */ public function getDate(): \DateTimeInterface { return $this->date; } - /** - * @return \DateTimeInterface - */ public function getUtcDate(): \DateTimeInterface { /** @var \DateTime|\DateTimeImmutable $date */ @@ -124,33 +68,21 @@ public function getUtcDate(): \DateTimeInterface return $date; } - /** - * @return HashCollection - */ public function getTarPackage(): HashCollection { return $this->tarPackage; } - /** - * @return HashCollection - */ public function getZipPackage(): HashCollection { return $this->zipPackage; } - /** - * @return ReleaseNotes - */ public function getReleaseNotes(): ReleaseNotes { return $this->releaseNotes; } - /** - * @return bool - */ public function isElts(): bool { return $this->elts; diff --git a/src/Model/AnnounceApi/ReleaseNotes.php b/src/Model/AnnounceApi/ReleaseNotes.php index 26fdc29..2404e5e 100644 --- a/src/Model/AnnounceApi/ReleaseNotes.php +++ b/src/Model/AnnounceApi/ReleaseNotes.php @@ -13,26 +13,14 @@ class ReleaseNotes implements \JsonSerializable { - private $newsLink; - private $news; - private $upgradingInstructions; - private $changes; - public function __construct( - string $newsLink, - string $news, - string $upgradingInstructions, - string $changes + private string $newsLink, + private string $news, + private string $upgradingInstructions, + private string $changes ) { - $this->newsLink = $newsLink; - $this->news = $news; - $this->upgradingInstructions = $upgradingInstructions; - $this->changes = $changes; } - /** - * @return array - */ public function jsonSerialize(): array { return [ @@ -43,33 +31,21 @@ public function jsonSerialize(): array ]; } - /** - * @return string - */ public function getNewsLink(): string { return $this->newsLink; } - /** - * @return string - */ public function getNews(): string { return $this->news; } - /** - * @return string - */ public function getUpgradingInstructions(): string { return $this->upgradingInstructions; } - /** - * @return string - */ public function getChanges(): string { return $this->changes; diff --git a/src/Service/AnnounceApiService.php b/src/Service/AnnounceApiService.php index cf09df4..35981df 100644 --- a/src/Service/AnnounceApiService.php +++ b/src/Service/AnnounceApiService.php @@ -21,30 +21,11 @@ class AnnounceApiService { - /** - * @var VariableResolveService - */ - private $variableResolveService; - - /** - * @var ClientInterface - */ - private $client; - - /** - * @var array - */ - private $configuration; - public function __construct( - VariableResolveService $variableResolveService, - ClientInterface $client, - array $configuration - ) { - $this->variableResolveService = $variableResolveService; - $this->client = $client; - $this->configuration = $configuration; - } + private VariableResolveService $variableResolveService, + private ClientInterface $client, + private array $configuration + ) {} public function getRelease(string $version) { @@ -202,7 +183,7 @@ private function json(ResponseInterface $response) return json_decode((string)$response->getBody(), true); } - private function buildRelease(array $json = null) + private function buildRelease(?array $json = null) { if (empty($json)) { return null; @@ -223,7 +204,7 @@ private function buildHashCollection(array $json) return new HashCollection($json); } - private function buildReleaseNotes(array $json = null) + private function buildReleaseNotes(?array $json = null) { if (empty($json)) { return null;