Internal - Fix php warnings, add psalm checks

pull/3543/head
Julio Montoya 4 years ago
parent c35fdc8fa9
commit 4f7f5a7e2a
  1. 12
      psalm.xml
  2. 7
      public/main/gradebook/gradebook_display_summary.php
  3. 14
      public/main/inc/lib/document.lib.php
  4. 1
      public/main/inc/lib/online.inc.php
  5. 2
      public/main/inc/lib/pdf.lib.php
  6. 3
      public/main/inc/lib/plugin.class.php
  7. 3
      public/main/inc/lib/promotion.lib.php
  8. 1
      src/CourseBundle/Entity/CNotebook.php

@ -90,11 +90,18 @@
<file name="public/main/inc/lib/notebook.lib.php"/> <file name="public/main/inc/lib/notebook.lib.php"/>
<file name="public/main/inc/lib/notification.lib.php"/> <file name="public/main/inc/lib/notification.lib.php"/>
<file name="public/main/inc/lib/NotificationEvent.php"/> <file name="public/main/inc/lib/NotificationEvent.php"/>
<file name="public/main/inc/lib/online.inc.php"/>
<!-- <file name="public/main/inc/lib/pdf.lib.php"/>-->
<!-- <file name="public/main/inc/lib/plugin.class.php"/>-->
<!-- <file name="public/main/inc/lib/plugin.lib.php"/>-->
<file name="public/main/inc/lib/redirect.class.php"/>
<file name="public/main/inc/lib/ScheduledAnnouncement.php"/>
<!-- <file name="public/main/inc/lib/security.lib.php"/>-->
<file name="public/main/inc/lib/sessionmanager.lib.php"/> <file name="public/main/inc/lib/sessionmanager.lib.php"/>
<!-- <file name="public/main/inc/lib/skill.lib.php"/>--> <!-- <file name="public/main/inc/lib/skill.lib.php"/>-->
<file name="public/main/inc/lib/link.lib.php"/>
<file name="public/main/inc/lib/legal.lib.php"/>
<file name="public/main/inc/lib/skill.visualizer.lib.php"/> <file name="public/main/inc/lib/skill.visualizer.lib.php"/>
<file name="public/main/inc/lib/social.lib.php"/> <file name="public/main/inc/lib/social.lib.php"/>
<file name="public/main/inc/lib/sortable_table.class.php"/> <file name="public/main/inc/lib/sortable_table.class.php"/>
@ -104,7 +111,6 @@
<file name="public/main/inc/lib/statistics.lib.php"/> <file name="public/main/inc/lib/statistics.lib.php"/>
<file name="public/main/inc/lib/SurveyTree.php"/> <file name="public/main/inc/lib/SurveyTree.php"/>
<file name="public/main/inc/lib/system_announcements.lib.php"/> <file name="public/main/inc/lib/system_announcements.lib.php"/>
<file name="public/main/inc/lib/table_sort.class.php"/> <file name="public/main/inc/lib/table_sort.class.php"/>
<file name="public/main/inc/lib/tablesort.lib.php"/> <file name="public/main/inc/lib/tablesort.lib.php"/>
<file name="public/main/inc/lib/TeacherTimeReport.php"/> <file name="public/main/inc/lib/TeacherTimeReport.php"/>

@ -154,13 +154,13 @@ $interbreadcrumb[] = [
]; ];
$interbreadcrumb[] = [ $interbreadcrumb[] = [
'url' => '#', 'url' => '#',
'name' => get_lang('AssessmentsListOfLearnersReports'), 'name' => get_lang('Students list report'),
]; ];
$this_section = SECTION_COURSES; $this_section = SECTION_COURSES;
Display::display_header(''); Display::display_header('');
$token = Security::get_token(); $token = Security::get_token();
echo Display::page_header(get_lang('AssessmentsListOfLearnersReports')); echo Display::page_header(get_lang('Students list report'));
echo '<div class="btn-group">'; echo '<div class="btn-group">';
if (count($userList) > 0) { if (count($userList) > 0) {
@ -188,7 +188,8 @@ if (0 == count($userList)) {
echo '<td>'; echo '<td>';
$link = ''; $link = '';
if ($allowSkillRelItem) { if ($allowSkillRelItem) {
$url = api_get_path(WEB_CODE_PATH).'gradebook/skill_rel_user.php?'.api_get_cidreq().'&user_id='.$value['user_id'].'&selectcat='.$cat_id; $url = api_get_path(WEB_CODE_PATH).
'gradebook/skill_rel_user.php?'.api_get_cidreq().'&user_id='.$value['user_id'].'&selectcat='.$cat_id;
$link = Display::url( $link = Display::url(
get_lang('Skills'), get_lang('Skills'),
$url, $url,

@ -1602,18 +1602,12 @@ class DocumentManager
$my_content_html = null; $my_content_html = null;
if ($document_id) { if ($document_id) {
$sql = "SELECT path FROM $tbl_document $repo = Container::getDocumentRepository();
WHERE iid = $document_id"; $doc = Container::getDocumentRepository()->find($document_id);
$rs = Database::query($sql);
$new_content = ''; $new_content = '';
$all_user_info = []; $all_user_info = [];
if (Database::num_rows($rs)) { if ($doc) {
$row = Database::fetch_array($rs); $my_content_html = $repo->getResourceFileContent($doc);
/*$filepath = api_get_path(SYS_COURSE_PATH).$courseInfo['path'].'/document'.$row['path'];
if (is_file($filepath)) {
$my_content_html = file_get_contents($filepath);
}*/
$my_content_html = '';
$all_user_info = self::get_all_info_to_certificate( $all_user_info = self::get_all_info_to_certificate(
$user_id, $user_id,
$courseInfo, $courseInfo,

@ -197,7 +197,6 @@ function online_logout($user_id = null, $logout_redirect = false)
} }
} }
api_delete_firstpage_parameter();
Session::erase('last_id'); Session::erase('last_id');
CourseChatUtils::exitChat($user_id); CourseChatUtils::exitChat($user_id);
session_regenerate_id(); session_regenerate_id();

@ -259,7 +259,7 @@ class PDF
} }
if ($printTitle) { if ($printTitle) {
$this->pdf->WriteHTML( $this->pdf->WriteHTML(
'<html><body><h3>'.$html_title.'</h3></body></html>'.$page_break '<html><body><h3>'.$htmlTitle.'</h3></body></html>'.$pageBreak
); );
} }
continue; continue;

@ -1035,7 +1035,7 @@ class Plugin
/** @var CTool $tool */ /** @var CTool $tool */
$tool = $em $tool = $em
->getRepository('ChamiloCourseBundle:CTool') ->getRepository(CTool::class)
->findOneBy([ ->findOneBy([
'name' => $name, 'name' => $name,
'course' => $courseId, 'course' => $courseId,
@ -1048,7 +1048,6 @@ class Plugin
$tool = new CTool(); $tool = new CTool();
$tool $tool
->setId($cToolId)
->setCourse(api_get_course_entity($courseId)) ->setCourse(api_get_course_entity($courseId))
->setName($name.$visibilityPerStatus) ->setName($name.$visibilityPerStatus)
->setLink($link ?: "$pluginName/start.php") ->setLink($link ?: "$pluginName/start.php")

@ -1,4 +1,5 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
@ -297,7 +298,7 @@ class Promotion extends Model
$promotion = new \Chamilo\CoreBundle\Entity\Promotion(); $promotion = new \Chamilo\CoreBundle\Entity\Promotion();
$em = Database::getManager(); $em = Database::getManager();
$repo = $em->getRepository('ChamiloCoreBundle:Career'); $repo = $em->getRepository(\Chamilo\CoreBundle\Entity\Career::class);
$promotion $promotion
->setName($params['name']) ->setName($params['name'])
->setStatus($params['status']) ->setStatus($params['status'])

@ -105,7 +105,6 @@ class CNotebook extends AbstractResource implements ResourceInterface
return $this->getTitle(); return $this->getTitle();
} }
/** /**
* Set userId. * Set userId.
* *

Loading…
Cancel
Save