diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-07-06 13:25:06 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2022-07-06 13:25:06 +0000 |
| commit | 89512696839235e4b3d2ca135917ae038ff5fc3c (patch) | |
| tree | e7870c1f8313dc39836745408dbb7a01f73a9b4e /lib/elearning | |
| parent | a5813cb77af590aaf2c49aea66f9d33d47b066f6 (diff) | |
fixes 'Method/function should return XY but return statement is missing', fixes #1278
Closes #1278
Merge request studip/studip!783
Diffstat (limited to 'lib/elearning')
| -rw-r--r-- | lib/elearning/ConnectedCMS.class.php | 7 | ||||
| -rw-r--r-- | lib/elearning/ConnectedUser.class.php | 22 | ||||
| -rw-r--r-- | lib/elearning/ELearningUtils.class.php | 2 | ||||
| -rw-r--r-- | lib/elearning/Ilias3ConnectedCMS.class.php | 4 | ||||
| -rw-r--r-- | lib/elearning/Ilias3ConnectedPermissions.class.php | 2 | ||||
| -rw-r--r-- | lib/elearning/Ilias3ConnectedUser.class.php | 27 | ||||
| -rw-r--r-- | lib/elearning/Ilias3ContentModule.class.php | 2 | ||||
| -rw-r--r-- | lib/elearning/Ilias4ConnectedCMS.class.php | 1 | ||||
| -rw-r--r-- | lib/elearning/ObjectConnections.class.php | 12 |
9 files changed, 32 insertions, 47 deletions
diff --git a/lib/elearning/ConnectedCMS.class.php b/lib/elearning/ConnectedCMS.class.php index 41640b7..0aac526 100644 --- a/lib/elearning/ConnectedCMS.class.php +++ b/lib/elearning/ConnectedCMS.class.php @@ -434,15 +434,10 @@ class ConnectedCMS } /** - * terminate - * - * dummy-method. returns false. can be overwritten by subclass. - * @access public - * @return boolean returns false + * dummy-method. can be overwritten by subclass. */ public function terminate() { - return false; } public function deleteConnectedModules($object_id){ diff --git a/lib/elearning/ConnectedUser.class.php b/lib/elearning/ConnectedUser.class.php index 9351955..3c74a14 100644 --- a/lib/elearning/ConnectedUser.class.php +++ b/lib/elearning/ConnectedUser.class.php @@ -100,6 +100,8 @@ class ConnectedUser $this->category = $data['external_user_category']; $this->type = $data['external_user_type']; $this->is_connected = true; + + return true; } /** @@ -168,13 +170,10 @@ class ConnectedUser /** * update user-account * - * dummy-method. returns false. must be overwritten by subclass. - * @access public - * @return boolean returns false + * dummy-method. must be overwritten by subclass. */ - function updateUser() + public function updateUser() { - return false; } /** @@ -464,13 +463,12 @@ class ConnectedUser } /** - * save connection for user-account - * - * saves user-connection to database and sets type for actual user - * @access public - * @param string $user_type user-type - */ - function setConnection($user_type) + * save connection for user-account + * + * saves user-connection to database and sets type for actual user + * @param string $user_type user-type + */ + public function setConnection($user_type) { $this->setUserType($user_type); diff --git a/lib/elearning/ELearningUtils.class.php b/lib/elearning/ELearningUtils.class.php index c5b22d1..ad49569 100644 --- a/lib/elearning/ELearningUtils.class.php +++ b/lib/elearning/ELearningUtils.class.php @@ -446,8 +446,6 @@ class ELearningUtils * delete cms-data * * deletes all data belonging to the specified cms from stud.ip database - * - * @return boolean successful */ public static function deleteCMSData($cms_type) { diff --git a/lib/elearning/Ilias3ConnectedCMS.class.php b/lib/elearning/Ilias3ConnectedCMS.class.php index 83e6921..69f1e52 100644 --- a/lib/elearning/Ilias3ConnectedCMS.class.php +++ b/lib/elearning/Ilias3ConnectedCMS.class.php @@ -337,10 +337,8 @@ class Ilias3ConnectedCMS extends ConnectedCMS * terminate * * terminates connection. - * @access public - * @return boolean returns false */ - function terminate() + public function terminate() { // $this->soap_client->logout(); $this->soap_client->saveCacheData(); diff --git a/lib/elearning/Ilias3ConnectedPermissions.class.php b/lib/elearning/Ilias3ConnectedPermissions.class.php index e3c3b20..17319d7 100644 --- a/lib/elearning/Ilias3ConnectedPermissions.class.php +++ b/lib/elearning/Ilias3ConnectedPermissions.class.php @@ -168,6 +168,8 @@ class Ilias3ConnectedPermissions extends ConnectedPermissions if (!$this->getContentModulePerms($course_id)) { $messages["info"] .= _("Für den zugeordneten ILIAS-Kurs konnten keine Berechtigungen ermittelt werden.") . "<br>"; } + + return true; } /** diff --git a/lib/elearning/Ilias3ConnectedUser.class.php b/lib/elearning/Ilias3ConnectedUser.class.php index 90170f1..ef98529 100644 --- a/lib/elearning/Ilias3ConnectedUser.class.php +++ b/lib/elearning/Ilias3ConnectedUser.class.php @@ -250,13 +250,9 @@ class Ilias3ConnectedUser extends ConnectedUser } /** - * update user - * - * update user-account - * @access public - * @return boolean returns false on error - */ - function updateUser() + * update user-account + */ + public function updateUser() { } @@ -288,18 +284,17 @@ class Ilias3ConnectedUser extends ConnectedUser } /** - * set connection - * - * set user connection - * @access public - * @param string user_type user-type - * @return boolean returns false on error - */ - function setConnection($user_type, $ignore_encrypt_passwords = false) + * set connection + * + * set user connection + * @access public + * @param string user_type user-type + */ + public function setConnection($user_type, $ignore_encrypt_passwords = false) { global $connected_cms; - if (!$ignore_encrypt_passwords && $connected_cms[$this->cms_type]->encrypt_passwords == "md5") + if (!$ignore_encrypt_passwords && $connected_cms[$this->cms_type]->encrypt_passwords === "md5") { // echo "PASSWORD-ENCRYPTION"; $this->external_password = $this->getCryptedPassword( $this->external_password ); diff --git a/lib/elearning/Ilias3ContentModule.class.php b/lib/elearning/Ilias3ContentModule.class.php index 95b2f8f..b1c913c 100644 --- a/lib/elearning/Ilias3ContentModule.class.php +++ b/lib/elearning/Ilias3ContentModule.class.php @@ -122,6 +122,8 @@ class Ilias3ContentModule extends ContentModule } // echo "PERM".implode($this->allowed_operations,"-"); + + return true; } /** diff --git a/lib/elearning/Ilias4ConnectedCMS.class.php b/lib/elearning/Ilias4ConnectedCMS.class.php index f9e566a..b8f0ea3 100644 --- a/lib/elearning/Ilias4ConnectedCMS.class.php +++ b/lib/elearning/Ilias4ConnectedCMS.class.php @@ -79,7 +79,6 @@ class Ilias4ConnectedCMS extends Ilias3ConnectedCMS * checks if there are modules in the course that are not connected to the seminar * @access public * @param string $course_id course-id - * @return boolean successful */ function updateConnections($course_id) { diff --git a/lib/elearning/ObjectConnections.class.php b/lib/elearning/ObjectConnections.class.php index fc28b9b..e360f71 100644 --- a/lib/elearning/ObjectConnections.class.php +++ b/lib/elearning/ObjectConnections.class.php @@ -106,14 +106,12 @@ class ObjectConnections * @param string $object_id object-id (optional) * @return boolean connection-status */ - public static function isObjectConnected($object_id = null) + public static function isObjectConnected($object_id) { - if (isset($object_id)) { - $query = "SELECT 1 FROM object_contentmodules WHERE object_id = ?"; - $statement = DBManager::get()->prepare($query); - $statement->execute([$object_id]); - return (bool)$statement->fetchColumn(); - } + $query = "SELECT 1 FROM object_contentmodules WHERE object_id = ?"; + $statement = DBManager::get()->prepare($query); + $statement->execute([$object_id]); + return (bool)$statement->fetchColumn(); } /** |
