Skip to content
Snippets Groups Projects
Commit 045cc974 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

valuestore class: php8 only; added variable types; short array syntax

parent 71f2b994
No related branches found
No related tags found
1 merge request!66php8 only; added variable types; short array syntax; remove glyphicons
......@@ -29,7 +29,7 @@
*
* Axel: <axel.hahn@unibe.ch>
* (...)
* 2024-08-29 Axel php8 only; added variable types; short array syntax
* 2024-09-02 Axel php8 only; added variable types; short array syntax
*/
class valuestore
{
......@@ -402,7 +402,7 @@ class valuestore
* @param string $sHost optional: hostname (for place deployed)
* @return string
*/
public function setPackage(string $sPackage, string $sPhase, string $sPlace = '', string $sHost = ''): string
public function setPackage(string $sPackage, string $sPhase, string $sPlace = '', string $sHost = ''): string
{
$this->sPackage = preg_replace('/[^a-z\-\_0-9]/', '', $sPackage);
$this->setPhase($sPhase, $sPlace, $sHost);
......@@ -418,7 +418,7 @@ class valuestore
* @param string $sHost optional: hostname (for place deployed)
* @return type string
*/
public function setPhase(string $sPhase, string $sPlace = '', string $sHost = ''): string
public function setPhase(string $sPhase, string $sPlace = '', string $sHost = ''): string
{
if (!$this->sProject && !$this->sPackage) {
$this->_quit(__FUNCTION__, "ERROR: you need to set a project. Use the setProject() method to do so.");
......@@ -583,11 +583,15 @@ class valuestore
);
}
/**
* update a version value
* @param type $sVersioninfos
* @return boolean
* update a version value. It returns the return value of updateVar().
* It returns a PDO result object.
* It aborts if project and package are not set
* It returns false on database query error
*
* @param string $sVersioninfos json of ci build data
* @return boolean|object
*/
public function updateVersion($sVersioninfos)
public function updateVersion($sVersioninfos): bool|object
{
return $this->updateVar('version', $sVersioninfos);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment