From 139f0e7bd4d1f05295c9497ba0d25b6ee71d13f8 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Fri, 29 Jan 2021 13:11:18 +0100 Subject: [PATCH] Fix psalm issues --- public/main/inc/lib/career.lib.php | 2 +- public/main/inc/lib/groupmanager.lib.php | 2 +- public/main/inc/lib/link.lib.php | 12 +++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/public/main/inc/lib/career.lib.php b/public/main/inc/lib/career.lib.php index 7331188820..9aa4836f16 100644 --- a/public/main/inc/lib/career.lib.php +++ b/public/main/inc/lib/career.lib.php @@ -567,7 +567,7 @@ class Career extends Model '', $explode[0] ); - $simpleFirstConnection = 'g'.(int) $groupValueId; + $simpleFirstConnection = 'g'.$groupValueId; } else { // Course block (row_123 id) if (!empty($explode[0])) { diff --git a/public/main/inc/lib/groupmanager.lib.php b/public/main/inc/lib/groupmanager.lib.php index 82e3ef9b7b..bbb8a6b8a2 100644 --- a/public/main/inc/lib/groupmanager.lib.php +++ b/public/main/inc/lib/groupmanager.lib.php @@ -3025,7 +3025,7 @@ class GroupManager // Check group document access $allow = api_get_configuration_value('group_document_access'); if ($allow) { - $documentAccess = (int) $group->getDocumentAccess(); + $documentAccess = $group->getDocumentAccess(); } // Check access for students diff --git a/public/main/inc/lib/link.lib.php b/public/main/inc/lib/link.lib.php index c52bb4eaf1..437407660d 100644 --- a/public/main/inc/lib/link.lib.php +++ b/public/main/inc/lib/link.lib.php @@ -155,9 +155,7 @@ class Link extends Model $link_id && extension_loaded('xapian') ) { require_once api_get_path(LIBRARY_PATH).'specific_fields_manager.lib.php'; - - $course_int_id = $_course['real_id']; - $courseCode = $_course['code']; + $courseCode = $course_info['code']; $specific_fields = get_specific_field_list(); $ic_slide = new IndexableChunk(); @@ -194,7 +192,7 @@ class Link extends Model SE_COURSE_ID => $courseCode, SE_TOOL_ID => TOOL_LINK, SE_DATA => [ - 'link_id' => (int) $link_id, + 'link_id' => $link_id, ], SE_USER => (int) api_get_user_id(), ]; @@ -211,8 +209,8 @@ class Link extends Model $sql_cat = sprintf( $sql_cat, $table_link_category, - (int) $categoryId, - $course_int_id + $categoryId, + $course_id ); $result = Database:: query($sql_cat); if (1 == Database:: num_rows($result)) { @@ -243,7 +241,7 @@ class Link extends Model $sql = sprintf( $sql, $tbl_se_ref, - $course_int_id, + $course_id, $courseCode, TOOL_LINK, $link_id,