mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-18 21:28:28 +01:00
Centralized git logic from InstallationTypeDetector and UpdateChecker in GitVersionInfoProvider service
This commit is contained in:
@@ -7,8 +7,8 @@ namespace App\State;
|
||||
use ApiPlatform\Metadata\Operation;
|
||||
use ApiPlatform\State\ProviderInterface;
|
||||
use App\ApiResource\PartDBInfo;
|
||||
use App\Services\Misc\GitVersionInfo;
|
||||
use App\Services\System\BannerHelper;
|
||||
use App\Services\System\GitVersionInfoProvider;
|
||||
use App\Settings\SystemSettings\CustomizationSettings;
|
||||
use App\Settings\SystemSettings\LocalizationSettings;
|
||||
use Shivas\VersioningBundle\Service\VersionManagerInterface;
|
||||
@@ -17,7 +17,7 @@ class PartDBInfoProvider implements ProviderInterface
|
||||
{
|
||||
|
||||
public function __construct(private readonly VersionManagerInterface $versionManager,
|
||||
private readonly GitVersionInfo $gitVersionInfo,
|
||||
private readonly GitVersionInfoProvider $gitVersionInfo,
|
||||
private readonly BannerHelper $bannerHelper,
|
||||
private readonly string $default_uri,
|
||||
private readonly LocalizationSettings $localizationSettings,
|
||||
@@ -31,8 +31,8 @@ class PartDBInfoProvider implements ProviderInterface
|
||||
{
|
||||
return new PartDBInfo(
|
||||
version: $this->versionManager->getVersion()->toString(),
|
||||
git_branch: $this->gitVersionInfo->getGitBranchName(),
|
||||
git_commit: $this->gitVersionInfo->getGitCommitHash(),
|
||||
git_branch: $this->gitVersionInfo->getBranchName(),
|
||||
git_commit: $this->gitVersionInfo->getCommitHash(),
|
||||
title: $this->customizationSettings->instanceName,
|
||||
banner: $this->bannerHelper->getBanner(),
|
||||
default_uri: $this->default_uri,
|
||||
|
||||
Reference in New Issue
Block a user