From adb605cac58dbd75b2770e5982af113cd2cf1311 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Thu, 29 Aug 2024 15:12:23 +0200
Subject: [PATCH] rolout interface: php8 only; added variable types

---
 .../deployment/classes/rollout.interface.php  | 75 +++++++++++++------
 1 file changed, 52 insertions(+), 23 deletions(-)

diff --git a/public_html/deployment/classes/rollout.interface.php b/public_html/deployment/classes/rollout.interface.php
index cc495b18..888e14ed 100644
--- a/public_html/deployment/classes/rollout.interface.php
+++ b/public_html/deployment/classes/rollout.interface.php
@@ -3,72 +3,101 @@
  * INTERFACE for rollout plugins
  * 
  * @author hahn
+ * 
+ * Axel <axel.hahn@unibe.ch>
+ * 2024-08-29  Axel php8 only; added variable types
  */
-interface iRolloutplugin {
+interface iRolloutplugin
+{
 
     // ----------------------------------------------------------------------
     // VERIFY
     // ----------------------------------------------------------------------
-    
+
     /**
-     * check requirements if the plugin could work
+     * Get an array with shell commands to check requirements if the plugin
+     * can work
+     * 
      * @return array
      */
     public function checkRequirements(): array;
-    
+
     /**
-     * check access to a deploy target
+     * Get an array with shell commands to check access to a deploy target
+     * 
+     * @return array
      */
-    public function checkConnectionToTarget();
+    public function checkConnectionToTarget(): array;
 
     // ----------------------------------------------------------------------
     // SETTER
     // ----------------------------------------------------------------------
-    
+
     // ----------------------------------------------------------------------
     // GETTER
     // ----------------------------------------------------------------------
 
     /**
-     * get configuration for the project .. or more specifi for a given phase
+     * Get configuration array for the project .. or more specific for a given phase
+     * 
      * @param  string   $sPhase
      * @param  boolean  $bMask   Flag for public output; if true then mask your secrets
      * @return array
      */
-    public function getConfig($sPhase=false, $bMask=false);
-    
+    public function getConfig(string $sPhase = '', bool $bMask = false): array;
+
     /**
-     * get an array with shell commands to execute
+     * Get an array with shell commands to execute for deployment of built file
+     * 
      * @param  string   $sPhase
      * @param  boolean  $bMask   Flag for public output; if true then mask your secrets
      * @return array
      */
-    public function getDeployCommands($sPhase, $bMask=false);
+    public function getDeployCommands(string $sPhase, bool $bMask = false): array;
 
     /**
-     * get name of plugin as string ... language specific
+     * Get name of plugin as string ... language specific
+     * @return string
      */
-    public function getName();
-    
+    public function getName(): string;
+
     /**
-     * get description of plugin as string ... language specific
+     * Get description of plugin as string ... language specific
+     * @return string
      */
-    public function getDescription();
-    
+    public function getDescription(): string;
+
     /**
-     * get array of data in info.js
+     * Get array of data in info.js
+     * @return array
      */
-    public function getPluginInfos();
+    public function getPluginInfos(): array;
+
     // ----------------------------------------------------------------------
     // RENDERER
     // ----------------------------------------------------------------------
-    public function renderFormdata4Project();
-    public function renderFormdata4Phase($sPhase);
+
+    /**
+     * form renderer: show 
+     * - formvars for project OR
+     * - a single message that no configuration items exists
+     * 
+     * @return string
+     */
+    public function renderFormdata4Project(): string;
+
+    /**
+     * form renderer: show configuration for a given phase
+     
+     * @param string $sPhase  phaese; one of preview|stage|live
+     * @return string
+     */
+    public function renderFormdata4Phase(string $sPhase): string;
 
     // ----------------------------------------------------------------------
     // ACTIONS
     // ----------------------------------------------------------------------
 
-    
+
 }
 
-- 
GitLab