diff --git a/locallib.php b/locallib.php index f55d071..34fc291 100644 --- a/locallib.php +++ b/locallib.php @@ -29,9 +29,9 @@ * of events have all the required attributes from the townsquaresupport interface. * * @param array $subevents - * @return int + * @return bool */ -function townsquaresupport_check_subplugin_events($subevents): int { +function townsquaresupport_check_subplugin_events($subevents): bool { if (!gettype($subevents == 'array')) { return false; } diff --git a/tests/eventcheck_test.php b/tests/eventcheck_test.php index ec3c1ab..bdcea33 100644 --- a/tests/eventcheck_test.php +++ b/tests/eventcheck_test.php @@ -96,9 +96,9 @@ private function helper_test_set_up(): void { 'timestart' => 123456787, 'coursemoduleid' => 16, 'eventtype' => 'eventtypeone', ]; // Build different combinations of the events. - $this->testdata->subevents1 = [$incorrecteevent1, $correctevent1]; - $this->testdata->subevents2 = [$incorrecteevent2, $correctevent2]; - $this->testdata->subevents3 = [$correctevent1, $correctevent2]; + $this->testdata->subevents1 = [(object)$incorrecteevent1, (object)$correctevent1]; + $this->testdata->subevents2 = [(object)$incorrecteevent2, (object)$correctevent2]; + $this->testdata->subevents3 = [(object)$correctevent1, (object)$correctevent2]; $this->testdata->subevents4 = ['arraykey' => 'incorrectsubevent']; }