aboutsummaryrefslogtreecommitdiff
path: root/lib/models/Courseware/StructuralElement.php
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2026-01-13 08:39:22 +0100
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2026-01-13 08:39:22 +0100
commitcb4bdf265fe84443f6000e4af6e132f5aa566e3f (patch)
tree659d81c24abb6888ddb16220bf570993c6469a66 /lib/models/Courseware/StructuralElement.php
parent246fe2c51046331af9c7509c201c937b2e433108 (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.php8
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) {