diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-13 08:39:22 +0100 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2026-01-13 08:39:22 +0100 |
| commit | cb4bdf265fe84443f6000e4af6e132f5aa566e3f (patch) | |
| tree | 659d81c24abb6888ddb16220bf570993c6469a66 /lib/models/Courseware/StructuralElement.php | |
| parent | 246fe2c51046331af9c7509c201c937b2e433108 (diff) | |
use rector to resolve implicitely nullable parameter declarations, fixes #5463
Closes #5463
Merge request studip/studip!4097
Diffstat (limited to 'lib/models/Courseware/StructuralElement.php')
| -rw-r--r-- | lib/models/Courseware/StructuralElement.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/models/Courseware/StructuralElement.php b/lib/models/Courseware/StructuralElement.php index 50ba714..4bbaad8 100644 --- a/lib/models/Courseware/StructuralElement.php +++ b/lib/models/Courseware/StructuralElement.php @@ -227,7 +227,7 @@ class StructuralElement extends \SimpleORMap implements \PrivacyObject, \Feedbac return self::getCourseware('', '', $root_id); } - private static function getCourseware(string $rangeId, string $rangeType, string $root_id = null): ?StructuralElement + private static function getCourseware(string $rangeId, string $rangeType, ?string $root_id = null): ?StructuralElement { if ($root_id) { $result = self::find($root_id); @@ -448,7 +448,7 @@ class StructuralElement extends \SimpleORMap implements \PrivacyObject, \Feedbac /** * @param \User|\Seminar_User $user */ - public function hasEditingPermission(User $user, Unit $unit = null): bool + public function hasEditingPermission(User $user, ?Unit $unit = null): bool { if (!isset($unit)) { $unit = $this->findUnit(); @@ -742,7 +742,7 @@ class StructuralElement extends \SimpleORMap implements \PrivacyObject, \Feedbac * * @return StructuralElement[] a list of all descendants */ - public function findDescendants(User $user = null) + public function findDescendants(?User $user = null) { $descendants = []; foreach ($this->children as $child) { @@ -1295,7 +1295,7 @@ SQL; return 'course/courseware/courseware/' . $unit->id . '?cid=' . $this->range_id . '#/structural_element/' . $this->id; } - public function isRangeAccessible(string $user_id = null): bool + public function isRangeAccessible(?string $user_id = null): bool { $user = \User::find($user_id); if ($user) { |
