‪TYPO3CMS  ‪main
MajorRelease.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 {
22  public function ‪__construct(
23  protected readonly string $version,
24  protected readonly ?string $lts,
25  protected readonly string $title,
26  protected readonly ‪MaintenanceWindow $maintenanceWindow
27  ) {}
28 
29  public static function ‪fromApiResponse(array $response): self
30  {
31  $maintenanceWindow = ‪MaintenanceWindow::fromApiResponse($response);
32  $ltsVersion = isset($response['lts']) ? (string)$response['lts'] : null;
33 
34  return new self((string)$response['version'], $ltsVersion, $response['title'], $maintenanceWindow);
35  }
36 
37  public function ‪getVersion(): string
38  {
39  return $this->version;
40  }
41 
42  public function ‪getLts(): ?string
43  {
44  return $this->lts;
45  }
46 
47  public function ‪getTitle(): string
48  {
49  return $this->title;
50  }
51 
53  {
54  return $this->maintenanceWindow;
55  }
56 }
‪TYPO3\CMS\Install\CoreVersion\MajorRelease\getMaintenanceWindow
‪getMaintenanceWindow()
Definition: MajorRelease.php:52
‪TYPO3\CMS\Install\CoreVersion
Definition: CoreRelease.php:18
‪TYPO3\CMS\Install\CoreVersion\MajorRelease\getLts
‪getLts()
Definition: MajorRelease.php:42
‪TYPO3\CMS\Install\CoreVersion\MajorRelease\fromApiResponse
‪static fromApiResponse(array $response)
Definition: MajorRelease.php:29
‪TYPO3\CMS\Install\CoreVersion\MaintenanceWindow
Definition: MaintenanceWindow.php:21
‪TYPO3\CMS\Install\CoreVersion\MajorRelease\getTitle
‪getTitle()
Definition: MajorRelease.php:47
‪TYPO3\CMS\Install\CoreVersion\MaintenanceWindow\fromApiResponse
‪static fromApiResponse(array $response)
Definition: MaintenanceWindow.php:27
‪TYPO3\CMS\Install\CoreVersion\MajorRelease\__construct
‪__construct(protected readonly string $version, protected readonly ?string $lts, protected readonly string $title, protected readonly MaintenanceWindow $maintenanceWindow)
Definition: MajorRelease.php:22
‪TYPO3\CMS\Install\CoreVersion\MajorRelease
Definition: MajorRelease.php:21
‪TYPO3\CMS\Install\CoreVersion\MajorRelease\getVersion
‪getVersion()
Definition: MajorRelease.php:37