diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-03 20:05:20 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-03 20:05:20 +0000 |
| commit | 430074ffa822c2456cabbbe77413fd2d615db7d4 (patch) | |
| tree | 69fa7661f44e0e202641d872b2074958c48d5599 /lib/models/User.class.php | |
| parent | 989e9fb694954a976d80fbfc67e37f417cf25ffa (diff) | |
adjustments due to phpstan report, fixes #2257
Closes #2257
Merge request studip/studip!1490
Diffstat (limited to 'lib/models/User.class.php')
| -rw-r--r-- | lib/models/User.class.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/models/User.class.php b/lib/models/User.class.php index 82709db..0653f5c 100644 --- a/lib/models/User.class.php +++ b/lib/models/User.class.php @@ -237,7 +237,10 @@ class User extends AuthUserMd5 implements Range, PrivacyObject */ public static function build($data, $is_new = true) { - $user = new static(); + // Note: This should be used instead of `new static()` since PHPStan + $class = get_called_class(); + $user = new $class(); + $user->info = new UserInfo(); $user->setData($data); $user->setNew($is_new); |
