MDL-81634 core: Fix all implicitly defined nullables

Note: This does not impact third-party libraries.
This commit is contained in:
Andrew Nicols
2024-08-02 14:11:12 +08:00
parent 8a6e8563fd
commit 024e36be17
391 changed files with 782 additions and 782 deletions
+6 -6
View File
@@ -469,8 +469,8 @@ class api {
* @return array the array of conversations
* @throws \moodle_exception
*/
public static function get_conversations($userid, $limitfrom = 0, $limitnum = 20, int $type = null,
bool $favourites = null, bool $mergeself = false) {
public static function get_conversations($userid, $limitfrom = 0, $limitnum = 20, ?int $type = null,
?bool $favourites = null, bool $mergeself = false) {
global $DB;
if (!is_null($type) && !in_array($type, [self::MESSAGE_CONVERSATION_TYPE_INDIVIDUAL,
@@ -1168,7 +1168,7 @@ class api {
* @param int $conversationid The id of the conversation
* @return bool Returns true if a user can delete the conversation, false otherwise.
*/
public static function can_delete_conversation(int $userid, int $conversationid = null): bool {
public static function can_delete_conversation(int $userid, ?int $conversationid = null): bool {
global $USER;
if (is_null($conversationid)) {
@@ -2089,9 +2089,9 @@ class api {
* @param int|null $contextid The id of the context
* @return \stdClass
*/
public static function create_conversation(int $type, array $userids, string $name = null,
int $enabled = self::MESSAGE_CONVERSATION_ENABLED, string $component = null,
string $itemtype = null, int $itemid = null, int $contextid = null) {
public static function create_conversation(int $type, array $userids, ?string $name = null,
int $enabled = self::MESSAGE_CONVERSATION_ENABLED, ?string $component = null,
?string $itemtype = null, ?int $itemid = null, ?int $contextid = null) {
global $DB;