From 94f256b94dca284ffe0f4e4be724b1da4ec4740f Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Mon, 19 Sep 2022 14:41:37 +0200 Subject: [PATCH] update doc blocs --- src/tinyrouter.class.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/tinyrouter.class.php b/src/tinyrouter.class.php index 947c42a..be9155c 100644 --- a/src/tinyrouter.class.php +++ b/src/tinyrouter.class.php @@ -15,7 +15,7 @@ * SERVICING, REPAIR OR CORRECTION.<br> * <br> * --------------------------------------------------------------------------------<br> - * @version 1.0 + * @version 1.1 * @author Axel Hahn * @link https://github.com/iml-it/appmonitor * @license GPL @@ -34,12 +34,14 @@ class tinyrouter{ /** * constructor - * @param $aRoutes array array of routings + * @param $aRoutes array array of routes * @param $sUrl string incoming url + * @return boolean */ - public function __construct($aRoutes=[], $sUrl=false){ + public function __construct($aRoutes=[],$sUrl=false){ $this->setRoutes($aRoutes); $this->setUrl($sUrl); + return true; } // ---------------------------------------------------------------------- @@ -49,6 +51,7 @@ class tinyrouter{ /** * detect last matching route item * if no route matches then it returns false + * @return array */ protected function _getRoute(){ $aReturn=[]; @@ -124,8 +127,9 @@ class tinyrouter{ } /** - * set incoming url - * @param string sUrl url to fetch; https://api.exaple.com/ + * set incoming url, add the request behind protocol and domain. + * @param string sUrl url to fetch; /api/v1/productbyid/3424084 + * @return boolean */ public function setUrl($sUrl){ $this->sUrl=$sUrl; @@ -138,7 +142,8 @@ class tinyrouter{ // ---------------------------------------------------------------------- /** - * helper function: get url parts as array + * helper function: get url request parts as array + * @param string $sUrl url to handle; /api/v1/productbyid/3424084 * @returns array */ public function getUrlParts($sUrl=false){ @@ -163,8 +168,9 @@ class tinyrouter{ } /** - * return the callback of matching route - * @return string + * return the callback iten of the matching route + * If no route was matching it returns false + * @return {*} */ public function getCallback(){ return isset($this->aMatch['callback']) ? $this->aMatch['callback'] : false; -- GitLab