Internal - Fix php warnings, add psalm checks

pull/3543/head
Julio Montoya 4 years ago
parent c35fdc8fa9
commit 4f7f5a7e2a
  1. 14
      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/notification.lib.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/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.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/sortable_table.class.php"/>
@ -104,7 +111,6 @@
<file name="public/main/inc/lib/statistics.lib.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/table_sort.class.php"/>
<file name="public/main/inc/lib/tablesort.lib.php"/>
<file name="public/main/inc/lib/TeacherTimeReport.php"/>

@ -154,13 +154,13 @@ $interbreadcrumb[] = [
];
$interbreadcrumb[] = [
'url' => '#',
'name' => get_lang('AssessmentsListOfLearnersReports'),
'name' => get_lang('Students list report'),
];
$this_section = SECTION_COURSES;
Display::display_header('');
$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">';
if (count($userList) > 0) {
@ -188,7 +188,8 @@ if (0 == count($userList)) {
echo '<td>';
$link = '';
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(
get_lang('Skills'),
$url,

@ -1602,18 +1602,12 @@ class DocumentManager
$my_content_html = null;
if ($document_id) {
$sql = "SELECT path FROM $tbl_document
WHERE iid = $document_id";
$rs = Database::query($sql);
$repo = Container::getDocumentRepository();
$doc = Container::getDocumentRepository()->find($document_id);
$new_content = '';
$all_user_info = [];
if (Database::num_rows($rs)) {
$row = Database::fetch_array($rs);
/*$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 = '';
if ($doc) {
$my_content_html = $repo->getResourceFileContent($doc);
$all_user_info = self::get_all_info_to_certificate(
$user_id,
$courseInfo,

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

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

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

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

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

Loading…
Cancel
Save