Skip to content

Commit

Permalink
MDL-78019 core: Whitespace fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Jun 1, 2023
1 parent e60843f commit 8d1a2c9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
34 changes: 17 additions & 17 deletions lib/tests/event/draft_file_deleted_test.php
Expand Up @@ -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();
Expand All @@ -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());
}
Expand Down
20 changes: 10 additions & 10 deletions repository/lib.php
Expand Up @@ -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();
}
Expand Down

0 comments on commit 8d1a2c9

Please sign in to comment.