This commit is contained in:
Huong Nguyen
2024-08-20 09:30:44 +07:00
395 changed files with 787 additions and 785 deletions
+3 -3
View File
@@ -57,7 +57,7 @@ abstract class contenttype {
*
* @param \context $context Optional context to check (default null)
*/
public function __construct(\context $context = null) {
public function __construct(?\context $context = null) {
if (empty($context)) {
$context = \context_system::instance();
}
@@ -71,7 +71,7 @@ abstract class contenttype {
* @param \stdClass $record An optional content record compatible object (default null)
* @return content Object with content bank information.
*/
public function create_content(\stdClass $record = null): content {
public function create_content(?\stdClass $record = null): content {
global $USER, $DB, $CFG;
$entry = new \stdClass();
@@ -109,7 +109,7 @@ abstract class contenttype {
* @param \stdClass|null $record an optional content record
* @return content Object with content bank information.
*/
public function upload_content(stored_file $file, \stdClass $record = null): content {
public function upload_content(stored_file $file, ?\stdClass $record = null): content {
if (empty($record)) {
$record = new \stdClass();
$record->name = $file->get_filename();