From 7246088edc574ec070f08596dfd1f349be08dcc0 Mon Sep 17 00:00:00 2001 From: Banana Date: Thu, 31 Dec 2020 11:45:40 +0100 Subject: [PATCH] jdoc cleanup --- webclient/lib/doomguy.class.php | 33 +++++--- webclient/lib/gorenest.class.php | 10 +-- webclient/lib/imdbwebparser.class.php | 2 +- .../lib/managecollectionfields.class.php | 18 ++--- webclient/lib/managecollections.class.php | 34 ++++----- webclient/lib/manageentry.class.php | 76 +++++++++---------- webclient/lib/mancubus.class.php | 50 +++++++----- webclient/lib/possessed.class.php | 32 ++++---- webclient/lib/spectre.class.php | 19 +++-- webclient/lib/summoner.class.php | 39 +++++----- webclient/lib/tentacle.class.php | 12 +-- webclient/lib/trite.class.php | 8 +- 12 files changed, 179 insertions(+), 154 deletions(-) diff --git a/webclient/lib/doomguy.class.php b/webclient/lib/doomguy.class.php index 2043f35..5d124aa 100644 --- a/webclient/lib/doomguy.class.php +++ b/webclient/lib/doomguy.class.php @@ -25,7 +25,7 @@ class Doomguy { /** * the global DB object * - * @var object + * @var mysqli */ private $_DB; @@ -46,7 +46,7 @@ class Doomguy { /** * the user ID from user management or default * - * @var Int + * @var integer */ protected $userID = 0; @@ -77,7 +77,7 @@ class Doomguy { /** * Doomguy constructor. * - * @param object $db The database object + * @param mysqli $db The database object */ public function __construct($db) { $this->_DB = $db; @@ -114,7 +114,7 @@ class Doomguy { /** * return the isSignedIn status. * - * @return boolean + * @return bool */ public function isSignedIn() { return $this->isSignedIn; @@ -160,7 +160,7 @@ class Doomguy { * check if the loaded user is in this group * if the user is in ADMIN_GROUP_ID, the he is automatically "in" every group * - * @param int $groupID + * @param integer $groupID * @return bool */ public function isInGroup($groupID) { @@ -223,7 +223,7 @@ class Doomguy { /** * Use the user identified by apitoken * - * @param $token string + * @param string $token */ public function authByApiToken($token) { if(!empty($token)) { @@ -247,11 +247,12 @@ class Doomguy { * * @param string $mode * @param bool $tableName - * @return string $str - * @throws Exception + * @return string */ public function getSQLRightsString($mode = "read", $tableName=false) { + $str = ''; $prefix = ''; + if(!empty($tableName)) { $prefix = "`".$tableName."`."; } @@ -271,7 +272,7 @@ class Doomguy { } } else { - throw new Exception("Site User: invalid rights string."); + error_log("[ERROR] ".__METHOD__." invalid rights string: ".var_export($this->_rightsArray, true)); } return $str; @@ -281,6 +282,8 @@ class Doomguy { * check if we can use session * we only use session if we can use cookies with the session * THIS DOES NOT CHECK IF THE USER HAS COOKIES ACTIVATED ! + * + * @return bool */ protected function _checkSession() { @@ -315,6 +318,8 @@ class Doomguy { /** * we have session data available. Now check if those data is valid + * + * @return bool */ protected function _checkAgainstSessionTable() { $ret = false; @@ -349,7 +354,7 @@ class Doomguy { * if so load the user data * * @param string $u - * @return boolean + * @return bool */ protected function _checkAgainstUserTable($u) { $ret = false; @@ -371,6 +376,8 @@ class Doomguy { /** * if we have to run some at login + * + * @return void */ protected function _loginActions() { # @todo: @@ -384,6 +391,8 @@ class Doomguy { /** * load the user and groups + * + * @return void */ protected function _loadUser() { if(!empty($this->userID)) { @@ -425,7 +434,7 @@ class Doomguy { /** * destroy and remove the current session from SESSION and session table * - * @return boolean + * @return bool */ protected function _destroySession() { $timeframe = date("Y-m-d H:i:s",time()-SESSION_LIFETIME); @@ -447,7 +456,7 @@ class Doomguy { * and a salt * * @param bool $salt - * @return bool + * @return bool|array */ protected function _createToken($salt=false) { $ret = false; diff --git a/webclient/lib/gorenest.class.php b/webclient/lib/gorenest.class.php index fc8ece4..f73b010 100644 --- a/webclient/lib/gorenest.class.php +++ b/webclient/lib/gorenest.class.php @@ -24,14 +24,14 @@ class GoreNest { /** * the global DB object * - * @var object + * @var mysqli */ private $_DB; /** * the current loaded user * - * @var object + * @var Doomguy */ private $_User; @@ -46,8 +46,8 @@ class GoreNest { /** * GoreNest constructor. * - * @param $db - * @param $user + * @param mysqli $db + * @param Doomguy $user */ public function __construct($db, $user) { $this->_DB = $db; @@ -59,7 +59,7 @@ class GoreNest { * This shows only entries which have a category set. * No category can be used for hidden entries. * - * @param $category + * @param string $category * @param bool $reload * @return array */ diff --git a/webclient/lib/imdbwebparser.class.php b/webclient/lib/imdbwebparser.class.php index 9af2fa8..fc3ecc1 100644 --- a/webclient/lib/imdbwebparser.class.php +++ b/webclient/lib/imdbwebparser.class.php @@ -16,7 +16,7 @@ * * * Functionality is the same but modified heavily to remove the does-not-make-sense static helper - * wich was not static since it depended on the IMDB class. Also some could not be extended or overwritten + * which was not static since it depended on the IMDB class. Also some could not be extended or overwritten * */ class IMDB diff --git a/webclient/lib/managecollectionfields.class.php b/webclient/lib/managecollectionfields.class.php index c4c6574..df2824b 100644 --- a/webclient/lib/managecollectionfields.class.php +++ b/webclient/lib/managecollectionfields.class.php @@ -24,14 +24,14 @@ class ManageCollectionFields { /** * The database object * - * @var object + * @var mysqli */ private $_DB; /** * The user object to query with * - * @var object + * @var Doomguy */ private $_User; @@ -61,8 +61,8 @@ class ManageCollectionFields { /** * ManageCollections constructor * - * @param $databaseConnectionObject - * @param $userObj + * @param mysqli $databaseConnectionObject + * @param Doomguy $userObj */ public function __construct($databaseConnectionObject, $userObj) { $this->_DB = $databaseConnectionObject; @@ -72,7 +72,7 @@ class ManageCollectionFields { /** * The id from the collection we are working with * - * @param $id integer + * @param integer $id */ public function setCollection($id) { if(!empty($id)) { @@ -106,7 +106,7 @@ class ManageCollectionFields { /** * Simple comma seperated number string * - * @param $string string + * @param string $string * @return bool */ public function validateFieldSortString($string) { @@ -121,11 +121,11 @@ class ManageCollectionFields { } /** - * $fieldsSortString have to valided already + * $fieldsSortString have to be validated already * * @todo remove non existing ones from table * - * @param $fieldsSortString string + * @param string $fieldsSortString * @return bool */ public function updateFields($fieldsSortString) { @@ -237,7 +237,7 @@ class ManageCollectionFields { * Get the required SQL information from given field ids * to create columns in entry table. * - * @param $columnIds array sort=>fk_field_id + * @param array $columnIds sort=>fk_field_id * @return array */ private function _getSQLForCollectionColumns($columnIds) { diff --git a/webclient/lib/managecollections.class.php b/webclient/lib/managecollections.class.php index 94952dd..6628bf8 100644 --- a/webclient/lib/managecollections.class.php +++ b/webclient/lib/managecollections.class.php @@ -23,22 +23,22 @@ class ManageCollections { /** * The database object * - * @var object + * @var mysqli */ private $_DB; /** * The user object to query with * - * @var object + * @var Doomguy */ private $_User; /** * ManageCollections constructor. * - * @param $databaseConnectionObject - * @param $userObj + * @param mysqli $databaseConnectionObject + * @param Doomguy $userObj */ public function __construct($databaseConnectionObject, $userObj) { $this->_DB = $databaseConnectionObject; @@ -48,17 +48,17 @@ class ManageCollections { /** * Load collection info from table. Checks user rights * - * @param $id - * @param string $ritghsMode + * @param string $id + * @param string $rightsMode * @return array */ - public function getCollection($id,$ritghsMode="read") { + public function getCollection($id,$rightsMode="read") { $ret = array(); if (Summoner::validate($id, 'digit')) { $queryStr = "SELECT `c`.`id`, `c`.`name`, `c`.`description`, `c`.`created` FROM `".DB_PREFIX."_collection` AS c - WHERE ".$this->_User->getSQLRightsString($ritghsMode, "c")." + WHERE ".$this->_User->getSQLRightsString($rightsMode, "c")." AND `c`.`id` = '".$this->_DB->real_escape_string($id)."'"; try { $query = $this->_DB->query($queryStr); @@ -67,7 +67,7 @@ class ManageCollections { } } catch (Exception $e) { - if(DEBUG) error_log("[DEBUG] ".__METHOD__." mysql catch: ".$e->getMessage()); + error_log("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage()); if(DEBUG) error_log("[DEBUG] ".__METHOD__." mysql query: ".$queryStr); } } @@ -164,7 +164,7 @@ class ManageCollections { } /** - * Fetch all availbale tools based on current user rights + * Fetch all available tools based on current user rights * * @return array */ @@ -357,7 +357,7 @@ class ManageCollections { /** * Delete collection identified by given id * - * @param $id string Number + * @param string $id Number * @return bool */ public function deleteCollection($id) { @@ -384,7 +384,7 @@ class ManageCollections { /** * Load the tools configured to the given collection * - * @param $id + * @param string $id Number * @return array */ public function getAvailableTools($id) { @@ -412,7 +412,7 @@ class ManageCollections { /** * Check if given name can be used as a new one * - * @param $name string + * @param string $name * @return bool */ private function _validNewCollectionName($name) { @@ -432,8 +432,8 @@ class ManageCollections { /** * Check if given name can be used as a new name for id * - * @param $name string - * @param $id string Number + * @param string $name + * @param string $id Number * @return bool */ private function _validUpdateCollectionName($name, $id) { @@ -457,8 +457,8 @@ class ManageCollections { /** * Update the given colletion ($id) with the given tool array * - * @param $id - * @param $tool + * @param string $id Number + * @param array $tool * @return bool */ private function _updateToolRelation($id,$tool) { diff --git a/webclient/lib/manageentry.class.php b/webclient/lib/manageentry.class.php index 6bfaee1..3e4956e 100644 --- a/webclient/lib/manageentry.class.php +++ b/webclient/lib/manageentry.class.php @@ -20,14 +20,14 @@ class Manageentry { /** * The database object * - * @var object + * @var mysqli */ private $_DB; /** * The user object to query with * - * @var object + * @var Doomguy */ private $_User; @@ -48,8 +48,8 @@ class Manageentry { /** * ManageCollections constructor. * - * @param $databaseConnectionObject - * @param $userObj + * @param mysqli $databaseConnectionObject + * @param Doomguy $userObj */ public function __construct($databaseConnectionObject, $userObj) { $this->_DB = $databaseConnectionObject; @@ -59,7 +59,7 @@ class Manageentry { /** * Set the collection to manage entries from * - * @param $collectionId + * @param sring $collectionId Number */ public function setCollection($collectionId) { if(!empty($collectionId)) { @@ -101,7 +101,7 @@ class Manageentry { * Load required data for edit. Uses some functions from Mancubus but has * different data layout. Checks write edit too * - * @param $entryId + * @param string $entryId Number * @return array */ public function getEditData($entryId) { @@ -228,7 +228,7 @@ class Manageentry { * Delete given entryId from currently loaded collection * Checks userrights too. * - * @param $entryId + * @param string $entryId Number * @return bool */ public function delete($entryId) { @@ -280,7 +280,7 @@ class Manageentry { /** * Validates that current use can write the given Entry * - * @param $entryId + * @param string $entryId Number * @return bool */ public function canEditEntry($entryId) { @@ -307,7 +307,7 @@ class Manageentry { * Check if given entryid can be deleted from current collection * and user * - * @param $entryId + * @param string $entryId Number * @return bool */ private function _canDelete($entryId) { @@ -335,8 +335,8 @@ class Manageentry { * In this case only the fields which have a _loadFieldValue_ method * are loaded. More is not needed here. * - * @param $entryData array - * @param $entryFields array + * @param array $entryData + * @param array $entryFields * @return array */ private function _mergeEntryWithFields($entryData, $entryFields) { @@ -357,7 +357,7 @@ class Manageentry { * lookup function for field type lookupmultiple * * @see Mancubus - * @param Number $entryId + * @param string $entryId Number * @param array $fieldData * @return array */ @@ -385,8 +385,8 @@ class Manageentry { * lookup function for field type upload * * @see Mancubus - * @param $entryId - * @param $fieldData + * @param string $entryId Number + * @param array $fieldData * @return string */ private function _loadFieldValue_upload($entryId, $fieldData) { @@ -409,8 +409,8 @@ class Manageentry { * lookup function for field type upload_multiple * * @see Mancubus - * @param $entryId - * @param $fieldData + * @param string $entryId Number + * @param array $fieldData * @return array */ private function _loadFieldValue_upload_multiple($entryId, $fieldData) { @@ -431,7 +431,7 @@ class Manageentry { * Provide the options for a selection field by processing the $data['value'] * since the values are stored in the entry DB as a list * - * @param $data array + * @param array $data * @return array */ private function _loadField_selection($data) { @@ -446,7 +446,7 @@ class Manageentry { /** * Load suggestions based on the existing data for this field * - * @param $data array Field data + * @param array $data Field data * @return array */ private function _loadField_lookupmultiple($data) { @@ -467,8 +467,8 @@ class Manageentry { /** * Create part of the insert statement for field type text * - * @param $data array Field data - * @param $queryData array Query data array + * @param array $data Field data + * @param array $queryData Query data array * @return array */ private function _saveField_text($data, $queryData) { @@ -479,8 +479,8 @@ class Manageentry { /** * Create part of the insert statement for field type text3 * - * @param $data array Field data - * @param $queryData array Query data array + * @param array $data Field data + * @param array $queryData Query data array * @return array */ private function _saveField_text3($data, $queryData) { @@ -490,8 +490,8 @@ class Manageentry { /** * Create part of the insert statement for field type textarea * - * @param $data array Field data - * @param $queryData array Query data array + * @param array $data Field data + * @param array $queryData Query data array * @return array */ private function _saveField_textarea($data, $queryData) { @@ -501,8 +501,8 @@ class Manageentry { /** * Create part of the insert statement for field type selection * - * @param $data array Field data - * @param $queryData array Query data array + * @param array $data Field data + * @param array $queryData Query data array * @return array */ private function _saveField_selection($data, $queryData) { @@ -511,8 +511,8 @@ class Manageentry { /** * Create part of the insert statement for field type year * - * @param $data array Field data - * @param $queryData array Query data array + * @param array $data Field data + * @param array $queryData Query data array * @return array */ private function _saveField_year($data, $queryData) { @@ -522,8 +522,8 @@ class Manageentry { /** * Create part of the insert statement for field type lookupmultiple * - * @param $data array Field data - * @param $queryData array Query data array + * @param array $data Field data + * @param array $queryData Query data array * @return array */ private function _saveField_lookupmultiple($data, $queryData) { @@ -553,8 +553,8 @@ class Manageentry { /** * Single upload field * - * @param $data array The data from _FILES - * @param $queryData array + * @param array $data The data from _FILES + * @param array $queryData * @return array */ private function _saveField_upload($data, $queryData) { @@ -587,8 +587,8 @@ class Manageentry { /** * Multiple upload field * - * @param $data array The data from _FILES - * @param $queryData array + * @param array $data The data from _FILES + * @param array $queryData * @return array */ private function _saveField_upload_multiple($data, $queryData) { @@ -622,8 +622,8 @@ class Manageentry { /** * runs the query and throws query execption if false * - * @param $queryString - * @param $insertId + * @param string $queryString + * @param string $insertId Number */ private function _runAfter_query($queryString, $insertId) { if(!empty($queryString) && !empty($insertId)) { @@ -641,8 +641,8 @@ class Manageentry { * * Also removes the defined uploads from multiple upload field * - * @param $uploadData - * @param $insertId + * @param array $uploadData + * @param string $insertId Number * @throws Exception */ private function _runAfter_upload($uploadData, $insertId) { diff --git a/webclient/lib/mancubus.class.php b/webclient/lib/mancubus.class.php index 1d67360..faf8c99 100644 --- a/webclient/lib/mancubus.class.php +++ b/webclient/lib/mancubus.class.php @@ -23,21 +23,21 @@ class Mancubus { /** * The database object * - * @var object + * @var mysqli */ private $_DB; /** * The user object to query with * - * @var object + * @var Doomguy */ private $_User; /** * Currently loaded collection to work with * - * @var number + * @var string Number */ private $_collectionId; @@ -55,8 +55,8 @@ class Mancubus { /** * Mancubus constructor. * - * @param $databaseConnectionObject - * @param $userObj + * @param mysqli $databaseConnectionObject + * @param Doomguy $userObj */ public function __construct($databaseConnectionObject, $userObj) { $this->_DB = $databaseConnectionObject; @@ -68,7 +68,7 @@ class Mancubus { /** * Set the to work with collection id * - * @param $collectionId Number + * @param string $collectionId Number */ public function setCollection($collectionId) { if(!empty($collectionId)) { @@ -100,8 +100,8 @@ class Mancubus { /** * Get all available collections for display based on current user * - * @param int $selections Number of selections - * @param int $entries Number of entries + * @param string $selections Number of selections + * @param string $entries Number of entries * @param string $search Search string to search for * @return array */ @@ -217,8 +217,8 @@ class Mancubus { } /** - * Retrive all the data needed to display the entry for given entryId - * @param $entryId + * Retrieve all the data needed to display the entry for given entryId + * @param string $entryId Number * @return array|mixed */ public function getEntry($entryId) { @@ -246,8 +246,8 @@ class Mancubus { /** * Get entries for loaded collection by looking for the given value in given field * - * @param Number $fieldId ID of the field to search in - * @param String $fieldValue Value of the field + * @param string $fieldId Number ID of the field to search in + * @param string $fieldValue Value of the field * @return array */ public function getEntriesByFieldValue($fieldId, $fieldValue) { @@ -314,7 +314,7 @@ class Mancubus { } /** - * Get tags for loaded collection. Provide earch term to use match against db search + * Get tags for loaded collection. Provide search term to use match against db search * * @todo Replace with trite class * @@ -351,6 +351,7 @@ class Mancubus { /** * Return the storage info for loaded collection * Used by API + * * @return array|mixed */ public function getEntryStructure() { @@ -364,6 +365,7 @@ class Mancubus { /** * Load the fields from the loaded collection + * * @return array */ private function _getEntryFields() { @@ -389,6 +391,7 @@ class Mancubus { /** * Merge the loaded information from collection_entry with the given * configured fields + * * @param array $entryData Loaded entry * @param array $entryFields Loaded fields * @return mixed @@ -419,7 +422,8 @@ class Mancubus { /** * Load the values for given $entryId for $fieldData * lookup function for field type lookupmultiple - * @param Numer $entryId + * + * @param string $entryId Number * @param array $fieldData * @return array */ @@ -445,8 +449,9 @@ class Mancubus { /** * Get the single upload file from storage location * lookup function for field type upload - * @param $entryId - * @param $fieldData + * + * @param string $entryId Number + * @param array $fieldData * @return string */ private function _loadFieldValue_upload($entryId, $fieldData) { @@ -467,8 +472,9 @@ class Mancubus { /** * Get the multiple upload files from storage location * lookup function for field type upload_multiple - * @param $entryId - * @param $fieldData + * + * @param string $entryId Number + * @param string $fieldData * @return array */ private function _loadFieldValue_upload_multiple($entryId, $fieldData) { @@ -488,7 +494,7 @@ class Mancubus { /** * Load and prepare the value for a selection field * - * @param $data string + * @param string $data * @return array */ private function _loadFieldSelection_selection($data) { @@ -571,8 +577,8 @@ class Mancubus { /** * Get the distinct data from a col and optionaml search term * - * @param $colname - * @param $search + * @param string $colname + * @param string $search * @return array */ private function _loadColAsTagFromEntryTable($colname,$search) { @@ -614,6 +620,8 @@ class Mancubus { /** * set some defaults by init of the class + * + * @return void */ private function _setDefaults() { // default query options diff --git a/webclient/lib/possessed.class.php b/webclient/lib/possessed.class.php index 873328b..9fa8192 100644 --- a/webclient/lib/possessed.class.php +++ b/webclient/lib/possessed.class.php @@ -29,10 +29,14 @@ class Possessed { /** * the global DB object * - * @var object + * @var mysqli */ private $_DB; + /** + * Possessed constructor. + * @param mysqli $db + */ public function __construct($db) { $this->_DB = $db; } @@ -80,10 +84,10 @@ class Possessed { /** * Create or update a user and set the required user releations * - * @param $username string - * @param $login string - * @param $password string - * @param $group string Number + * @param string $username + * @param string $login + * @param string $password + * @param string $group Number * @param bool $active * @return bool */ @@ -139,11 +143,11 @@ class Possessed { /** * Update given user id with given data * - * @param $id - * @param $username - * @param $login - * @param $password - * @param $group + * @param string $id Number + * @param string $username + * @param string $login + * @param string $password + * @param string $group * @param bool $active * @param bool $refreshApiToken * @return bool @@ -202,7 +206,7 @@ class Possessed { /** * Load the userinformation and groups for given id * - * @param $userId string Number + * @param string $userId Number * @return array */ public function getEditData($userId) { @@ -227,7 +231,7 @@ class Possessed { /** * Delete user by given user id * - * @param $id string Number + * @param string $id Number * @return bool */ public function deleteUser($id) { @@ -318,7 +322,7 @@ class Possessed { } /** - * Set user to group releation in database. + * Set user to group relation in database. * clean will delete all existing ones for given userid first. * * @param string $userid Number @@ -349,7 +353,7 @@ class Possessed { /** * Load all the groups the user is in and the information of them * - * @param $userId string Number + * @param string $userId Number * @return array */ private function _loadUserGroupInfo($userId) { diff --git a/webclient/lib/spectre.class.php b/webclient/lib/spectre.class.php index fcb1d74..6ba38ac 100644 --- a/webclient/lib/spectre.class.php +++ b/webclient/lib/spectre.class.php @@ -24,24 +24,29 @@ class Spectre { /** * the global DB object * - * @var object + * @var mysqli */ private $_DB; /** * The user object to query with * - * @var object + * @var Doomguy */ private $_User; + /** + * Allowed request params + * + * @var array + */ private $_allowedRequests = array('default','list','add','addInfo'); /** * Spectre constructor. * - * @param $databaseConnectionObject - * @param $userObj + * @param mysqli $databaseConnectionObject + * @param Doomguy $userObj */ public function __construct($databaseConnectionObject, $userObj) { $this->_DB = $databaseConnectionObject; @@ -51,7 +56,7 @@ class Spectre { /** * Validate given request string * - * @param $request string + * @param string $request * @return bool */ public function allowedRequests($request) { @@ -68,7 +73,7 @@ class Spectre { * With given data build the structure to create a add post * request * - * @param $data + * @param array $data * @return array */ public function buildAddStructure($data) { @@ -88,7 +93,7 @@ class Spectre { * POST via web frontend creates * "The problem occurs when you have a form that uses both single file and HTML array feature." * - * @param $data + * @param array $data * @return array */ public function prepareFilesArray($data) { diff --git a/webclient/lib/summoner.class.php b/webclient/lib/summoner.class.php index 1d38ffc..6ab6d26 100644 --- a/webclient/lib/summoner.class.php +++ b/webclient/lib/summoner.class.php @@ -27,7 +27,7 @@ class Summoner { * @param string $file relative path from THEME/ * @param string $theme Theme name * @param string $defaultTheme Default theme name can be overwritten - * @return boolean|string False of nothing is found + * @return bool|string False of nothing is found */ static function themefile($file, $theme, $defaultTheme='default') { $ret = false; @@ -194,7 +194,7 @@ class Summoner { * then create the rights string * IMPORTANT: keep the order otherwise the rights will be messed up * - * @param $rightsArr array + * @param array $rightsArr * @return mixed */ static function prepareRightsString($rightsArr) { @@ -257,7 +257,7 @@ class Summoner { /** * Creates from given rights string the rights array - * @param $rightsString + * @param string $rightsString * @return array */ static function prepareRightsArray($rightsString) { @@ -345,7 +345,7 @@ class Summoner { * with full path to the files * @param string $directory The absolute path to the directory * @param array $ignore An Array with strings to ignored - * @param boolean $recursive If we run a recursive scan or not + * @param bool $recursive If we run a recursive scan or not * @return array */ static function readDir($directory,$ignore=array(),$recursive=false) { @@ -382,9 +382,9 @@ class Summoner { * $empty = true => empty the diretory but do not delete it * * @param string $directory - * @param boolean $empty + * @param bool $empty * @param mixed $fTime If not false remove files older then this value in sec. - * @return boolean + * @return bool */ static function recursive_remove_directory($directory, $empty=false,$fTime=false) { // if the path has a slash at the end we remove it here @@ -459,7 +459,7 @@ class Summoner { /** * execute a curl call to the fiven $url * @param string $url The request url - * @param int $port + * @param integer $port * @return bool|string */ static function curlCall($url,$port=80) { @@ -477,9 +477,6 @@ class Summoner { if(is_string($do) === true) { $ret = $do; } - else { - $ret = false; - } curl_close($ch); @@ -491,7 +488,7 @@ class Summoner { * * @param string $haystack * @param string $needle - * @return boolean + * @return bool */ static function startsWith($haystack, $needle) { $length = strlen($needle); @@ -503,7 +500,7 @@ class Summoner { * * @param string $haystack * @param string $needle - * @return boolean + * @return bool */ static function endsWith($haystack, $needle) { $length = strlen($needle); @@ -521,7 +518,7 @@ class Summoner { * @param string $file The absolute path to the image file * @param number $width * @param number $height - * @return boolean + * @return bool */ static function createThumbnail($file,$width=ADMIN_THUMBNAIL_DEFAULT_WIDTH,$height=ADMIN_THUMBNAIL_DEFAULT_HEIGHT) { $ret = false; @@ -624,9 +621,9 @@ class Summoner { /** * based on self::ifset check also the value * - * @param $array - * @param $key - * @param $value + * @param array $array + * @param string $key + * @param string $value * @return bool */ static function ifsetValue($array,$key,$value) { @@ -637,11 +634,11 @@ class Summoner { } /** - * Replace in $heystack the $needle with $replace only once + * Replace in $haystack the $needle with $replace only once * - * @param $haystack string - * @param $needle string - * @param $replace string + * @param string $haystack + * @param string $needle + * @param string $replace * @return string */ static function replaceOnce($haystack, $needle, $replace) { @@ -658,7 +655,7 @@ class Summoner { * modify will add: key AND value not empty * modify will remove: only key with no value * - * @param $array + * @param array $array * @param array $modify * @return string */ diff --git a/webclient/lib/tentacle.class.php b/webclient/lib/tentacle.class.php index 344793f..d5168b1 100644 --- a/webclient/lib/tentacle.class.php +++ b/webclient/lib/tentacle.class.php @@ -24,22 +24,22 @@ class Tentacle { /** * the global DB object * - * @var object + * @var mysqli */ private $_DB; /** * The user object to query with * - * @var object + * @var Doomguy */ private $_User; /** * Tentacle constructor. * - * @param $databaseConnectionObject - * @param $userObj + * @param mysqli $databaseConnectionObject + * @param Doomguy $userObj */ public function __construct($databaseConnectionObject, $userObj) { $this->_DB = $databaseConnectionObject; @@ -49,7 +49,7 @@ class Tentacle { /** * Validate if given action is a valid tool and if the user has access * - * @param $identifier + * @param string $identifier * @return bool */ public function validate($identifier) { @@ -57,7 +57,7 @@ class Tentacle { $queryStr = "SELECT `name`,`description`,`action` FROM `".DB_PREFIX."_tool` - WHERE ".$this->_User->getSQLRightsString("read")." + WHERE ".$this->_User->getSQLRightsString()." AND `action` = '".$this->_DB->real_escape_string($identifier)."'"; try { $query = $this->_DB->query($queryStr); diff --git a/webclient/lib/trite.class.php b/webclient/lib/trite.class.php index 02d5d48..3b6bcbc 100644 --- a/webclient/lib/trite.class.php +++ b/webclient/lib/trite.class.php @@ -27,21 +27,21 @@ class Trite { /** * The database object * - * @var object + * @var mysqli */ private $_DB; /** * The user object to query with * - * @var object + * @var Doomguy */ private $_User; /** * Currently loaded collection to work with * - * @var number + * @var string */ private $_id; @@ -178,6 +178,8 @@ class Trite { /** * set some defaults by init of the class + * + * @return void */ private function _setDefaults() { // default query options -- 2.39.5