PHPDoc Kommentare für Deployment- und Docker-Dienste hinzugefügt: Verbesserte Dokumentation und Code-Nachvollziehbarkeit

This commit is contained in:
2026-03-27 14:50:23 +01:00
parent 39042b0236
commit ee1b9bafc7
2 changed files with 186 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<?php
/*
* GitDeployment.php 2026-03-25 thomas
* GitDeployment.php 2026-03-27 thomas
*
* Copyright (c) 2026 Thomas Schneider <thomas@inter-mundos.de>
* Alle Rechte vorbehalten.
@@ -39,6 +39,20 @@ class GitDeployment extends DeploymentService
}
/**
* Handles the deployment process for the specified project by fetching the required
* resources and deploying the appropriate version.
*
* This method first fetches the necessary project resources. Then, it delegates
* the deployment process to the deployment method, optionally using the provided
* version and step parameters.
*
* @param Project $project The project to handle.
* @param string $version An optional specific version to deploy. Defaults to an empty string.
* @param string $step An optional step parameter used during the handling process. Defaults to an empty string.
*
* @return void
*/
public function handle(Project $project, string $version = '', string $step = ''): void
{
$this->fetch($project);
@@ -46,6 +60,23 @@ class GitDeployment extends DeploymentService
}
/**
* Fetches the latest updates for the specified project's repository.
* Depending on the state of the repository directory, either a fetch or
* a full clone operation is performed. Supports authenticated access to
* repositories when a URL with HTTP is provided.
*
* If the repository is already cloned, this method performs a fetch operation
* to synchronize the local repository. Otherwise, it clones the repository in
* mirror mode to the designated directory.
*
* During the process, the deployment step is updated to reflect the current
* stage of the fetch operation for the given project.
*
* @param Project $project The project whose repository updates are to be fetched.
*
* @return void
*/
public function fetch(Project $project): void
{
$this->projectConfigDirService->setDeploymentStep($project->projectDir, 'fetch');
@@ -81,6 +112,19 @@ class GitDeployment extends DeploymentService
}
/**
* Deploys the specified project by preparing a clean working directory,
* cloning the git repository, and checking out the appropriate version.
*
* If the version is set to "default", it translates to the current state of
* the default branch in the repository. If set to "latest" or if no version
* is provided, the latest release of the repository is checked out.
*
* @param Project $project The project to be deployed.
* @param string $version The version to be deployed, which could be explicit, "default", or "latest".
*
* @return void
*/
public function deploy(Project $project, string $version): void
{
# remove work tree