diff --git a/main/exercise/question_pool.php b/main/exercise/question_pool.php index ceffcac783..ef1c0657cc 100755 --- a/main/exercise/question_pool.php +++ b/main/exercise/question_pool.php @@ -1048,7 +1048,7 @@ $table = new HTML_Table(['class' => 'table table-bordered data_table'], false); $row = 0; $column = 0; foreach ($headers as $header) { - $table->setHeaderContents($row,$column , $header); + $table->setHeaderContents($row, $column, $header); $column++; } diff --git a/main/inc/lib/display.lib.php b/main/inc/lib/display.lib.php index 6e490c63ac..9d5d859a07 100755 --- a/main/inc/lib/display.lib.php +++ b/main/inc/lib/display.lib.php @@ -892,7 +892,7 @@ class Display // When moving this to production, the return_icon() calls should // ask for the SVG version directly $svgIcons = api_get_setting('icons_mode_svg'); - if ($svgIcons == 'true' && $return_only_path == false) { + if ($svgIcons === 'true' && $return_only_path == false) { $svgImage = substr($image, 0, -3).'svg'; if (is_file($code_path.$theme.'svg/'.$svgImage)) { $icon = $w_code_path.$theme.'svg/'.$svgImage; diff --git a/main/inc/lib/groupmanager.lib.php b/main/inc/lib/groupmanager.lib.php index d5c91ae6ee..ce92f42e34 100755 --- a/main/inc/lib/groupmanager.lib.php +++ b/main/inc/lib/groupmanager.lib.php @@ -2239,8 +2239,8 @@ class GroupManager /** * Get all groups where a specific user is subscribed. * - * @param int $user_id - * @param int $courseId + * @param int $user_id + * @param int $courseId * @param int|null $sessionId * * @return array diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index 6f1caffc11..056274656f 100755 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -1,4 +1,5 @@ ".MESSAGE_STATUS_OUTBOX; $rs = Database::query($sql); @@ -862,10 +861,10 @@ class MessageManager // Delete attachment file. self::delete_message_attachment_file($id, $user_receiver_id); // Soft delete message. - $query = "UPDATE $table + $query = "UPDATE $table SET msg_status = ".MESSAGE_STATUS_DELETED." WHERE - id = $id AND + id = $id AND user_receiver_id = $user_receiver_id "; Database::query($query); @@ -1044,7 +1043,7 @@ class MessageManager $path_message_attach = $path_user_info['dir'].'message_attachments/'; if (is_file($path_message_attach.$path)) { if (rename($path_message_attach.$path, $path_message_attach.$new_path)) { - $sql = "UPDATE $table_message_attach + $sql = "UPDATE $table_message_attach SET path = '$new_path' WHERE id = $attach_id "; Database::query($sql); @@ -1355,8 +1354,8 @@ class MessageManager } $query = "SELECT * FROM $table - WHERE - id = $messageId AND + WHERE + id = $messageId AND $userCondition msg_status = $status"; $result = Database::query($query); @@ -2093,8 +2092,8 @@ class MessageManager $table = Database::get_main_table(TABLE_MESSAGE); $messageId = (int) $messageId; $sql = "SELECT * FROM $table - WHERE - id = '$messageId' AND + WHERE + id = '$messageId' AND msg_status <> '".MESSAGE_STATUS_DELETED."' "; $res = Database::query($sql); $item = []; @@ -2479,7 +2478,7 @@ class MessageManager } $messagesTable = Database::get_main_table(TABLE_MESSAGE); $userTable = Database::get_main_table(TABLE_MAIN_USER); - $sql = "SELECT m.*, u.user_id, u.lastname, u.firstname, u.picture_uri + $sql = "SELECT m.*, u.user_id, u.lastname, u.firstname, u.picture_uri FROM $messagesTable as m INNER JOIN $userTable as u ON m.user_sender_id = u.user_id @@ -2523,13 +2522,13 @@ class MessageManager $messagesTable = Database::get_main_table(TABLE_MESSAGE); $userTable = Database::get_main_table(TABLE_MAIN_USER); - $sql = "SELECT m.*, u.user_id, u.lastname, u.firstname, u.picture_uri + $sql = "SELECT m.*, u.user_id, u.lastname, u.firstname, u.picture_uri FROM $messagesTable as m INNER JOIN $userTable as u ON m.user_receiver_id = u.user_id WHERE - m.user_sender_id = $userId - AND m.msg_status = ".MESSAGE_STATUS_OUTBOX." + m.user_sender_id = $userId + AND m.msg_status = ".MESSAGE_STATUS_OUTBOX." AND m.id > $lastId ORDER BY m.send_date DESC"; @@ -2887,7 +2886,7 @@ class MessageManager return []; } - $sql = "SELECT DISTINCT * + $sql = "SELECT DISTINCT * FROM $messagesTable WHERE (user_receiver_id = $userId AND user_sender_id = $otherUserId) OR @@ -3084,7 +3083,7 @@ class MessageManager } $table = Database::get_main_table(TABLE_MESSAGE); - $sql = "SELECT COUNT(id) as count + $sql = "SELECT COUNT(id) as count FROM $table WHERE user_receiver_id = $userId AND diff --git a/main/inc/lib/sessionmanager.lib.php b/main/inc/lib/sessionmanager.lib.php index 0745612254..07ff241ff1 100755 --- a/main/inc/lib/sessionmanager.lib.php +++ b/main/inc/lib/sessionmanager.lib.php @@ -7618,7 +7618,7 @@ class SessionManager $sessionFieldValueList[$fieldId] = $sessionFieldValue; } } - + foreach ($sessionFieldValueList as $sessionFieldValue) { $extrafieldVariable = $fields[$sessionFieldValue['field_id']]; $extrafieldValue = $sessionFieldValue['value']; diff --git a/plugin/migrationmoodle/src/Loader/CourseCategoriesLoader.php b/plugin/migrationmoodle/src/Loader/CourseCategoriesLoader.php index 234ded9e53..864bf13897 100644 --- a/plugin/migrationmoodle/src/Loader/CourseCategoriesLoader.php +++ b/plugin/migrationmoodle/src/Loader/CourseCategoriesLoader.php @@ -15,8 +15,6 @@ class CourseCategoriesLoader implements LoaderInterface /** * Load the data and return the ID inserted. * - * @param array $incomingData - * * @return int */ public function load(array $incomingData) diff --git a/plugin/migrationmoodle/src/Loader/CourseFilesLoader.php b/plugin/migrationmoodle/src/Loader/CourseFilesLoader.php index c697b96f1c..a6bd2f8769 100644 --- a/plugin/migrationmoodle/src/Loader/CourseFilesLoader.php +++ b/plugin/migrationmoodle/src/Loader/CourseFilesLoader.php @@ -20,8 +20,6 @@ class CourseFilesLoader implements LoaderInterface /** * Load the data and return the ID inserted. * - * @param array $incomingData - * * @throws \Exception * * @return int diff --git a/plugin/migrationmoodle/src/Loader/CourseIntroductionLoader.php b/plugin/migrationmoodle/src/Loader/CourseIntroductionLoader.php index b141c0cbd0..591c6dec67 100644 --- a/plugin/migrationmoodle/src/Loader/CourseIntroductionLoader.php +++ b/plugin/migrationmoodle/src/Loader/CourseIntroductionLoader.php @@ -3,7 +3,6 @@ namespace Chamilo\PluginBundle\MigrationMoodle\Loader; -use Chamilo\CourseBundle\Entity\CToolIntro; use Chamilo\PluginBundle\MigrationMoodle\Interfaces\LoaderInterface; /** diff --git a/plugin/migrationmoodle/src/Loader/LessonPagesLoader.php b/plugin/migrationmoodle/src/Loader/LessonPagesLoader.php index 6902e0c5d8..d0f23181a1 100644 --- a/plugin/migrationmoodle/src/Loader/LessonPagesLoader.php +++ b/plugin/migrationmoodle/src/Loader/LessonPagesLoader.php @@ -17,8 +17,6 @@ class LessonPagesLoader implements LoaderInterface /** * Load the data and return the ID inserted. * - * @param array $incomingData - * * @return int */ public function load(array $incomingData) diff --git a/plugin/migrationmoodle/src/Loader/UserLearnPathLessonAttemptLoader.php b/plugin/migrationmoodle/src/Loader/UserLearnPathLessonAttemptLoader.php index 112caec2d5..45cb765985 100644 --- a/plugin/migrationmoodle/src/Loader/UserLearnPathLessonAttemptLoader.php +++ b/plugin/migrationmoodle/src/Loader/UserLearnPathLessonAttemptLoader.php @@ -11,8 +11,6 @@ namespace Chamilo\PluginBundle\MigrationMoodle\Loader; class UserLearnPathLessonAttemptLoader extends UserLearnPathLessonBranchLoader { /** - * @param array $incomingData - * * @throws \Exception * * @return int diff --git a/plugin/migrationmoodle/src/Loader/UserLearnPathLessonBranchLoader.php b/plugin/migrationmoodle/src/Loader/UserLearnPathLessonBranchLoader.php index 81d2868364..075f15b777 100644 --- a/plugin/migrationmoodle/src/Loader/UserLearnPathLessonBranchLoader.php +++ b/plugin/migrationmoodle/src/Loader/UserLearnPathLessonBranchLoader.php @@ -3,7 +3,6 @@ namespace Chamilo\PluginBundle\MigrationMoodle\Loader; -use Chamilo\CourseBundle\Entity\CLpItemView; use Chamilo\PluginBundle\MigrationMoodle\Interfaces\LoaderInterface; /** @@ -52,10 +51,9 @@ class UserLearnPathLessonBranchLoader implements LoaderInterface } /** - * @param array $incomingData - * @return array - * * @throws \Exception + * + * @return array */ private function findViewOfItem(array $incomingData) { @@ -70,18 +68,16 @@ class UserLearnPathLessonBranchLoader implements LoaderInterface ); if (!$itemView) { - throw new \Exception("Item view not found for " - ."item ({$incomingData['item_id']}) and user ({$incomingData['user_id']})."); + throw new \Exception("Item view not found for "."item ({$incomingData['item_id']}) and user ({$incomingData['user_id']})."); } return $itemView; } /** - * @param array $incomingData - * @return array - * * @throws \Exception + * + * @return array */ private function findViewOfPreviousItem(array $incomingData) { @@ -96,8 +92,7 @@ class UserLearnPathLessonBranchLoader implements LoaderInterface $previousItemView = \Database::fetch_assoc($result); if (!$previousItemView) { - throw new \Exception("Item view not found for " - ."previous item ({$incomingData['item_id']}) and user ({$incomingData['user_id']})."); + throw new \Exception("Item view not found for "."previous item ({$incomingData['item_id']}) and user ({$incomingData['user_id']})."); } return $previousItemView; diff --git a/plugin/migrationmoodle/src/Loader/UserLearnPathLessonTimerLoader.php b/plugin/migrationmoodle/src/Loader/UserLearnPathLessonTimerLoader.php index ce4d28a925..053b5e1bf9 100644 --- a/plugin/migrationmoodle/src/Loader/UserLearnPathLessonTimerLoader.php +++ b/plugin/migrationmoodle/src/Loader/UserLearnPathLessonTimerLoader.php @@ -3,7 +3,6 @@ namespace Chamilo\PluginBundle\MigrationMoodle\Loader; -use Chamilo\CourseBundle\Entity\CLpItemView; use Chamilo\PluginBundle\MigrationMoodle\Interfaces\LoaderInterface; /** @@ -34,10 +33,9 @@ class UserLearnPathLessonTimerLoader implements LoaderInterface } /** - * @param array $incomingData - * @return array - * * @throws \Exception + * + * @return array */ private function findViewOfParentItem(array $incomingData) { @@ -60,10 +58,9 @@ class UserLearnPathLessonTimerLoader implements LoaderInterface } /** - * @param array $incomingData - * @return array - * * @throws \Exception + * + * @return array */ private function findViewOfFirstItem(array $incomingData) { @@ -85,8 +82,7 @@ class UserLearnPathLessonTimerLoader implements LoaderInterface ); if (!$itemView) { - throw new \Exception("Item view not found for item with" - ." parent item ({$incomingData['parent_item_id']}) and user ({$incomingData['user_id']})"); + throw new \Exception("Item view not found for item with"." parent item ({$incomingData['parent_item_id']}) and user ({$incomingData['user_id']})"); } return $itemView; diff --git a/plugin/migrationmoodle/src/Loader/UserLearnPathQuizLoader.php b/plugin/migrationmoodle/src/Loader/UserLearnPathQuizLoader.php index 36ac1f623e..dde61fbdda 100644 --- a/plugin/migrationmoodle/src/Loader/UserLearnPathQuizLoader.php +++ b/plugin/migrationmoodle/src/Loader/UserLearnPathQuizLoader.php @@ -3,7 +3,6 @@ namespace Chamilo\PluginBundle\MigrationMoodle\Loader; -use Chamilo\CourseBundle\Entity\CLpItemView; use Chamilo\PluginBundle\MigrationMoodle\Interfaces\LoaderInterface; /** diff --git a/plugin/migrationmoodle/src/Loader/UserLearnPathsLoader.php b/plugin/migrationmoodle/src/Loader/UserLearnPathsLoader.php index 3302c3f90c..8922725c1d 100644 --- a/plugin/migrationmoodle/src/Loader/UserLearnPathsLoader.php +++ b/plugin/migrationmoodle/src/Loader/UserLearnPathsLoader.php @@ -3,7 +3,6 @@ namespace Chamilo\PluginBundle\MigrationMoodle\Loader; -use Chamilo\CoreBundle\Entity\SessionRelCourseRelUser; use Chamilo\PluginBundle\MigrationMoodle\Interfaces\LoaderInterface; /** diff --git a/plugin/migrationmoodle/src/Loader/UsersScormsViewLoader.php b/plugin/migrationmoodle/src/Loader/UsersScormsViewLoader.php index 145b224cd8..59a0a178e9 100644 --- a/plugin/migrationmoodle/src/Loader/UsersScormsViewLoader.php +++ b/plugin/migrationmoodle/src/Loader/UsersScormsViewLoader.php @@ -3,7 +3,6 @@ namespace Chamilo\PluginBundle\MigrationMoodle\Loader; -use Chamilo\CoreBundle\Entity\Session; use Chamilo\PluginBundle\MigrationMoodle\Interfaces\LoaderInterface; /** diff --git a/plugin/migrationmoodle/src/MigrationMoodlePlugin.php b/plugin/migrationmoodle/src/MigrationMoodlePlugin.php index 53e7e63d8f..8ce07908c3 100644 --- a/plugin/migrationmoodle/src/MigrationMoodlePlugin.php +++ b/plugin/migrationmoodle/src/MigrationMoodlePlugin.php @@ -157,7 +157,7 @@ class MigrationMoodlePlugin extends Plugin implements HookPluginInterface 'where' => [ 'name = ?' => Database::escape_string($name.'_task'), 'or name = ?' => Database::escape_string($name.'_script'), - ] + ], ], 'first' ); diff --git a/plugin/migrationmoodle/src/Script/BaseScript.php b/plugin/migrationmoodle/src/Script/BaseScript.php index e931091edc..e3ad7717cc 100644 --- a/plugin/migrationmoodle/src/Script/BaseScript.php +++ b/plugin/migrationmoodle/src/Script/BaseScript.php @@ -32,7 +32,7 @@ abstract class BaseScript $this->process(); } - abstract function process(); + abstract public function process(); /** * @param string $message