diff --git a/public/main/exercise/exercise.class.php b/public/main/exercise/exercise.class.php index 896e83aae2..48458e2d65 100644 --- a/public/main/exercise/exercise.class.php +++ b/public/main/exercise/exercise.class.php @@ -6125,12 +6125,12 @@ class Exercise * @return bool */ public function send_mail_notification_for_exam( - $type = 'end', + $type, $question_list_answers, $origin, $exe_id, - $score = null, - $weight = null + $score, + $weight ) { $setting = api_get_course_setting('email_alert_manager_on_new_quiz'); @@ -7682,7 +7682,7 @@ class Exercise $current_question, $questions_in_media = [], $last_question_in_media = false, - $realQuestionList, + $realQuestionList = [], $generateJS = true ) { // With this option on the question is loaded via AJAX diff --git a/public/main/inc/lib/CourseChatUtils.php b/public/main/inc/lib/CourseChatUtils.php index 13c43d6225..2470537bd6 100644 --- a/public/main/inc/lib/CourseChatUtils.php +++ b/public/main/inc/lib/CourseChatUtils.php @@ -37,7 +37,7 @@ class CourseChatUtils * @param int $sessionId * @param int $groupId */ - public function __construct($courseId, $userId, $sessionId = 0, $groupId = 0, ResourceNode $resourceNode, ResourceRepository $repository) + public function __construct($courseId, $userId, $sessionId, $groupId, ResourceNode $resourceNode, ResourceRepository $repository) { $this->courseId = (int) $courseId; $this->userId = (int) $userId; diff --git a/public/main/inc/lib/agenda.lib.php b/public/main/inc/lib/agenda.lib.php index 887606b529..ff7e381705 100644 --- a/public/main/inc/lib/agenda.lib.php +++ b/public/main/inc/lib/agenda.lib.php @@ -2980,10 +2980,10 @@ class Agenda */ public static function get_global_agenda_items( $agendaitems, - $day = "", - $month = "", - $year = "", - $week = "", + $day, + $month, + $year, + $week, $type ) { $tbl_global_agenda = Database::get_main_table( @@ -3109,10 +3109,10 @@ class Agenda public static function get_personal_agenda_items( $user_id, $agendaitems, - $day = "", - $month = "", - $year = "", - $week = "", + $day, + $month, + $year, + $week, $type ) { $tbl_personal_agenda = Database::get_main_table(TABLE_PERSONAL_AGENDA); @@ -3235,7 +3235,7 @@ class Agenda $agendaitems, $month, $year, - $weekdaynames = [], + $weekdaynames, $monthName, $show_content = true ) { diff --git a/public/main/inc/lib/career.lib.php b/public/main/inc/lib/career.lib.php index 25f5bba009..726084e194 100644 --- a/public/main/inc/lib/career.lib.php +++ b/public/main/inc/lib/career.lib.php @@ -863,7 +863,7 @@ class Career extends Model * * @return string */ - public static function parseVertexList($groupCourseList, $vertexList, $addRow = 0, &$graph, $group, &$connections, $userResult) + public static function parseVertexList($groupCourseList, $vertexList, $addRow, &$graph, $group, &$connections, $userResult) { if (empty($vertexList)) { return ''; diff --git a/public/main/inc/lib/formvalidator/FormValidator.class.php b/public/main/inc/lib/formvalidator/FormValidator.class.php index 53855b48c5..07decc1791 100644 --- a/public/main/inc/lib/formvalidator/FormValidator.class.php +++ b/public/main/inc/lib/formvalidator/FormValidator.class.php @@ -1012,7 +1012,7 @@ EOT; * @param string $title visible title * @param array $groupList list of group or elements */ - public function addPanelOption($name, $title, $groupList, $icon, $open = false, $parent) + public function addPanelOption($name, $title, $groupList, $icon, $open, $parent) { $html = '
'; $html .= '
'; diff --git a/public/main/inc/lib/sessionmanager.lib.php b/public/main/inc/lib/sessionmanager.lib.php index fcc3183bcf..f8be013fa2 100644 --- a/public/main/inc/lib/sessionmanager.lib.php +++ b/public/main/inc/lib/sessionmanager.lib.php @@ -814,8 +814,8 @@ class SessionManager * @return array table with user name, lp name, progress */ public static function get_session_lp_progress( - $sessionId = 0, - $courseId = 0, + $sessionId, + $courseId, $date_from, $date_to, $options @@ -935,9 +935,9 @@ class SessionManager * @return array table with user name, lp name, progress */ public static function get_survey_overview( - $sessionId = 0, - $courseId = 0, - $surveyId = 0, + $sessionId, + $courseId, + $surveyId, $date_from, $date_to, $options @@ -1408,7 +1408,7 @@ class SessionManager $profile = '', $date_from = '', $date_to = '', - $options + $options = [] ) { $sessionId = intval($sessionId); $courseId = intval($courseId); diff --git a/public/main/lp/learnpath.class.php b/public/main/lp/learnpath.class.php index 82c594906a..2338a59e09 100644 --- a/public/main/lp/learnpath.class.php +++ b/public/main/lp/learnpath.class.php @@ -6906,7 +6906,7 @@ class learnpath * * @return string HTML form */ - public function display_link_form($action = 'add', $lpItem, $link) + public function display_link_form($action, $lpItem, $link) { $item_url = ''; if ($link) { @@ -6941,7 +6941,7 @@ class learnpath * * @return string HTML form */ - public function display_quiz_form($action = 'add', $lpItem, $exercise) + public function display_quiz_form($action, $lpItem, $exercise) { $form = new FormValidator( 'quiz_form', @@ -6965,7 +6965,7 @@ class learnpath * * @return string HTML form */ - public function display_forum_form($action = 'add', $lpItem, $resource) + public function display_forum_form($action, $lpItem, $resource) { $form = new FormValidator( 'forum_form', @@ -6994,7 +6994,7 @@ class learnpath * * @return string HTML form */ - public function display_thread_form($action = 'add', $lpItem, $resource) + public function display_thread_form($action, $lpItem, $resource) { $form = new FormValidator( 'thread_form', @@ -7046,11 +7046,8 @@ class learnpath * * @return string HTML form */ - public function display_student_publication_form( - $action = 'add', - CLpItem $lpItem, - $resource - ) { + public function display_student_publication_form($action, CLpItem $lpItem, $resource) + { $form = new FormValidator('frm_student_publication', 'post', '#'); LearnPathItemForm::setForm($form, 'edit', $this, $lpItem); diff --git a/src/CourseBundle/Repository/CForumPostRepository.php b/src/CourseBundle/Repository/CForumPostRepository.php index 9e8104cf3b..1393079820 100644 --- a/src/CourseBundle/Repository/CForumPostRepository.php +++ b/src/CourseBundle/Repository/CForumPostRepository.php @@ -23,12 +23,12 @@ class CForumPostRepository extends ResourceRepository } /** - * @param bool $onlyVisibles + * @param bool $onlyVisible * @param bool $isAllowedToEdit * @param string $orderDirection */ public function findAllInCourseByThread( - $onlyVisibles, + $onlyVisible, $isAllowedToEdit, CForumThread $thread, Course $course, @@ -36,24 +36,24 @@ class CForumPostRepository extends ResourceRepository CGroup $group = null, $orderDirection = 'ASC' ): array { - $conditionVisibility = $onlyVisibles ? 'p.visible = 1' : 'p.visible != 2'; - $conditionModetared = ''; + $conditionVisibility = $onlyVisible ? 'p.visible = 1' : 'p.visible != 2'; + $conditionModerated = ''; $filterModerated = true; if ( (empty($group) && $isAllowedToEdit) || ( (null !== $group ? $group->userIsTutor($currentUser) : false) || - !$onlyVisibles + !$onlyVisible ) ) { $filterModerated = false; } - if ($filterModerated && $onlyVisibles && $thread->getForum()->isModerated()) { + if ($filterModerated && $onlyVisible && $thread->getForum()->isModerated()) { $userId = null !== $currentUser ? $currentUser->getId() : 0; - $conditionModetared = 'AND p.status = 1 OR + $conditionModerated = 'AND p.status = 1 OR (p.status = '.CForumPost::STATUS_WAITING_MODERATION." AND p.posterId = {$userId}) OR (p.status = ".CForumPost::STATUS_REJECTED." AND p.poster = {$userId}) OR (p.status IS NULL AND p.posterId = {$userId})"; @@ -65,7 +65,7 @@ class CForumPostRepository extends ResourceRepository p.thread = :thread AND p.cId = :course AND {$conditionVisibility} - {$conditionModetared} + {$conditionModerated} ORDER BY p.iid {$orderDirection}"; return $this