From e343ab9eed1bc44a33f45967d994aaab6b926438 Mon Sep 17 00:00:00 2001 From: Elmar Ludwig <elmar.ludwig@uni-osnabrueck.de> Date: Tue, 14 Feb 2023 13:06:27 +0000 Subject: [PATCH] fix type hints, closes #2162 Closes #2162 Merge request studip/studip!1396 --- .../Routes/Courseware/UserProgressesOfUnitsShow.php | 4 ++-- lib/models/Courseware/Instance.php | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/classes/JsonApi/Routes/Courseware/UserProgressesOfUnitsShow.php b/lib/classes/JsonApi/Routes/Courseware/UserProgressesOfUnitsShow.php index 48e7c95e470..1e1745e2cde 100644 --- a/lib/classes/JsonApi/Routes/Courseware/UserProgressesOfUnitsShow.php +++ b/lib/classes/JsonApi/Routes/Courseware/UserProgressesOfUnitsShow.php @@ -95,7 +95,7 @@ class UserProgressesOfUnitsShow extends NonJsonApiController } private function getSelfProgresses( - iterable &$allBlockIds, + array &$allBlockIds, string $elementId, array &$userProgresses, array &$courseMemberIds @@ -188,4 +188,4 @@ class UserProgressesOfUnitsShow extends NonJsonApiController return $data; } -} \ No newline at end of file +} diff --git a/lib/models/Courseware/Instance.php b/lib/models/Courseware/Instance.php index bee37016af2..5cff95314bd 100644 --- a/lib/models/Courseware/Instance.php +++ b/lib/models/Courseware/Instance.php @@ -412,7 +412,7 @@ class Instance return StructuralElement::findUsersBookmarksByRange($user, $this->getRange()); } - public function findAllStructuralElements(): iterable + public function findAllStructuralElements(): array { $sql = 'SELECT se.* FROM cw_structural_elements se @@ -428,7 +428,7 @@ class Instance return $data; } - public function findAllBlocks(): iterable + public function findAllBlocks(): array { $sql = 'SELECT b.* FROM cw_structural_elements se @@ -452,10 +452,10 @@ class Instance * * @param ?callable(array $row): mixed $formatter Provide your own callable if you need something else instead of * full-blown instances of \Courseware\Block. - * @return iterable all the (optionally formatted) blocks grouped by the IDs of the structural element containing + * @return array all the (optionally formatted) blocks grouped by the IDs of the structural element containing * that block. */ - public function findAllBlocksGroupedByStructuralElementId(callable $formatter = null): iterable + public function findAllBlocksGroupedByStructuralElementId(callable $formatter = null): array { if (!$formatter) { $formatter = function ($row) { -- GitLab