Skip to content

Commit 8c01738

Browse files
committed
Webservice: Improve function parameters strictness - refs #4647
1 parent 8aac38b commit 8c01738

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

main/inc/lib/webservices/Rest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,8 +1639,9 @@ public function getUsersCampus(array $params): array
16391639
* return all the courses.
16401640
*
16411641
* @param int $campusId
1642+
* @return array
16421643
*/
1643-
public function getCoursesCampus($campusId = null): array
1644+
public function getCoursesCampus(int $campusId = 0): array
16441645
{
16451646
return CourseManager::get_courses_list(
16461647
0, //offset
@@ -1658,9 +1659,11 @@ public function getCoursesCampus($campusId = null): array
16581659
* Returns a list of sessions in the given URL. If no URL is provided, we assume we are not in a multi-URL setup and
16591660
* return all the sessions.
16601661
*
1661-
* @param int $campusId
1662+
* @param int $campusId Optional
1663+
* @return array
1664+
* @throws Exception
16621665
*/
1663-
public function getSessionsCampus(int $campusId = null): array
1666+
public function getSessionsCampus(int $campusId = 0): array
16641667
{
16651668
self::protectAdminEndpoint();
16661669

0 commit comments

Comments
 (0)