From 8d1a2c960abe2cfdec0528a0ed37578add2f97a3 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 1 Jun 2023 10:20:06 +0800 Subject: [PATCH] MDL-78019 core: Whitespace fixes --- lib/tests/event/draft_file_deleted_test.php | 34 ++++++++++----------- repository/lib.php | 20 ++++++------ 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/tests/event/draft_file_deleted_test.php b/lib/tests/event/draft_file_deleted_test.php index 95ed6ed811f55..32034a508be3b 100644 --- a/lib/tests/event/draft_file_deleted_test.php +++ b/lib/tests/event/draft_file_deleted_test.php @@ -48,28 +48,28 @@ public function test_event() { $fs = get_file_storage(); $filerecord = [ - 'contextid' => $usercontext->id, - 'component' => 'core', - 'filearea' => 'unittest', - 'itemid' => 0, - 'filepath' => '/', - 'filename' => 'test.txt', - 'source' => 'Copyright stuff', + 'contextid' => $usercontext->id, + 'component' => 'core', + 'filearea' => 'unittest', + 'itemid' => 0, + 'filepath' => '/', + 'filename' => 'test.txt', + 'source' => 'Copyright stuff', ]; $originalfile = $fs->create_file_from_string($filerecord, 'Test content'); $nbsp = "\xc2\xa0"; // Event data for logging. $eventdata = [ - 'objectid' => $originalfile->get_id(), - 'context' => $usercontext, - 'other' => [ - 'itemid' => $originalfile->get_itemid(), - 'filename' => $originalfile->get_filename(), - 'filesize' => $originalfile->get_filesize(), - 'filepath' => $originalfile->get_filepath(), - 'contenthash' => $originalfile->get_contenthash(), - ] + 'objectid' => $originalfile->get_id(), + 'context' => $usercontext, + 'other' => [ + 'itemid' => $originalfile->get_itemid(), + 'filename' => $originalfile->get_filename(), + 'filesize' => $originalfile->get_filesize(), + 'filepath' => $originalfile->get_filepath(), + 'contenthash' => $originalfile->get_contenthash(), + ], ]; $event = \core\event\draft_file_deleted::create($eventdata); $event->trigger(); @@ -79,7 +79,7 @@ public function test_event() { $event = reset($events); $this->assertEquals($usercontext, $event->get_context()); - $expected = "The user with id '{$user->id}' has deleted file '/test.txt' from the draft file area with item id 0. ". + $expected = "The user with id '{$user->id}' has deleted file '/test.txt' from the draft file area with item id 0. " . "Size: 12{$nbsp}bytes. Content hash: {$originalfile->get_contenthash()}."; $this->assertSame($expected, $event->get_description()); } diff --git a/repository/lib.php b/repository/lib.php index 9f384a13b114b..3f2e4ffeaadb4 100644 --- a/repository/lib.php +++ b/repository/lib.php @@ -3269,17 +3269,17 @@ function repository_delete_selected_files($context, string $component, string $f * @param context $context The context where delete is called. * @param stored_file $storedfile the file to be logged. */ -function create_event_draft_file_deleted(context $context, stored_file $storedfile) :void { +function create_event_draft_file_deleted(context $context, stored_file $storedfile): void { $logevent = \core\event\draft_file_deleted::create([ - 'objectid' => $storedfile->get_id(), - 'context' => $context, - 'other' => [ - 'itemid' => $storedfile->get_itemid(), - 'filename' => $storedfile->get_filename(), - 'filesize' => $storedfile->get_filesize(), - 'filepath' => $storedfile->get_filepath(), - 'contenthash' => $storedfile->get_contenthash(), - ], + 'objectid' => $storedfile->get_id(), + 'context' => $context, + 'other' => [ + 'itemid' => $storedfile->get_itemid(), + 'filename' => $storedfile->get_filename(), + 'filesize' => $storedfile->get_filesize(), + 'filepath' => $storedfile->get_filepath(), + 'contenthash' => $storedfile->get_contenthash(), + ], ]); $logevent->trigger(); }