From 80aa991d6d89d09686d5fe6363ef03b77cf706da Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Fri, 23 Aug 2024 16:06:49 +0200 Subject: [PATCH] fix php parser problems --- .../deployment/classes/foremanapi.class.php | 27 +++++++++---------- .../deployment/classes/formgen.class.php | 1 - 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/public_html/deployment/classes/foremanapi.class.php b/public_html/deployment/classes/foremanapi.class.php index 1e703028..3ecb6add 100644 --- a/public_html/deployment/classes/foremanapi.class.php +++ b/public_html/deployment/classes/foremanapi.class.php @@ -116,13 +116,13 @@ class ForemanApi { /** * last request - * @var type + * @var array */ protected $_aRequest=array(); /** * last response - * @var type + * @var array */ protected $_aResponse=array(); @@ -135,12 +135,9 @@ class ForemanApi { public function __construct($aCfg) { if(!isset($aCfg['api'])){ die("ERROR: class ".__CLASS__." must be initialized with an array containing api config for foreman."); - return false; } $this->_aCfg=$aCfg; - - return true; - } + } // ---------------------------------------------------------------------- // private functions @@ -159,10 +156,10 @@ class ForemanApi { /** * search url prefix in $this->_aAllowedUrls by given key - * @param type $sFunction - * @return type + * @param string $sFunction + * @return string */ - protected function _guessPrefixUrl($sFunction=false){ + protected function _guessPrefixUrl($sFunction=''){ $sReturn=''; /* if (!$sFunction){ @@ -232,7 +229,7 @@ class ForemanApi { * - postdata; for POST only * * @param array $aRequest arrayurl for Foreman API - * @return string + * @return array */ protected function _httpCall($aRequest=false, $iTimeout = 15) { if ($aRequest){ @@ -433,7 +430,7 @@ class ForemanApi { /** * check for missing config entries - * @return type + * @return bool */ public function selfcheck() { $sOut=''; @@ -498,7 +495,7 @@ class ForemanApi { * - list of keys, i.e. array('id', 'title') * * @param array $aOptions - * @return array + * @return bool|array */ public function read($aOptions){ $this->_aRequest=$aOptions; @@ -512,7 +509,7 @@ class ForemanApi { /** * TODO - * @param type $aOptions + * @param array $aOptions */ public function update($aOptions){ /* @@ -524,7 +521,7 @@ class ForemanApi { /** * TODO - * @param type $aOptions + * @param array $aOptions */ public function delete($aOptions){ /* @@ -573,7 +570,7 @@ class ForemanApi { [local_port] => 33906 ) * @param string $sKey get value of given key only - * @return any + * @return mixed */ public function getResponseInfo($sKey=false){ diff --git a/public_html/deployment/classes/formgen.class.php b/public_html/deployment/classes/formgen.class.php index 55db58b3..bd226b00 100644 --- a/public_html/deployment/classes/formgen.class.php +++ b/public_html/deployment/classes/formgen.class.php @@ -331,7 +331,6 @@ class formgen default: die("ERROR: " . __CLASS__ . ":" . __FUNCTION__ . " - formelement type " . $elementData["type"] . " ist not supported (yet)."); - break; } // Default or table mode? -- GitLab