Create everything required to login and register

This commit is contained in:
Tim
2023-04-02 19:34:00 +02:00
parent 82d5625e60
commit 5be77eeba1
26 changed files with 1664 additions and 55 deletions

View File

@ -0,0 +1,68 @@
<?php
namespace App\Service;
use JetBrains\PhpStorm\ArrayShape;
class LastRelease
{
#[ArrayShape([
"branch" => "string",
"date" => "string",
"commitHashShort" => "string",
"commitHashLong" => "string",
"commitDate" => "string",
"branchUrl" => "string",
"projectUrl" => "string",
"commitUrl" => "string",
])]
private array $lastRelease = [];
public function __construct(string $jsonFile)
{
if (file_exists($jsonFile)) {
$this->lastRelease = json_decode(file_get_contents($jsonFile), true);
}
}
public function getBranch(): string
{
return $this->lastRelease['branch'] ?? '-';
}
public function getBranchUrl(): string
{
return $this->lastRelease['branchUrl'] ?? '#';
}
public function getProjectUrl(): string
{
return $this->lastRelease['projectUrl'] ?? '#';
}
public function getCommitUrl(): string
{
return $this->lastRelease['commitUrl'] ?? '#';
}
public function getDate(): string
{
return $this->lastRelease['date'] ?? '-';
}
public function getCommitHashShort(): string
{
return $this->lastRelease['commitHashShort'] ?? '-';
}
public function getCommitHashLong(): string
{
return $this->lastRelease['commitHashLong'] ?? '-';
}
public function getCommitDate(): string
{
return $this->lastRelease['commitDate'] ?? '-';
}
}