diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-02-16 13:46:41 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2024-02-16 13:46:41 +0000 |
| commit | 34b470106f8980ed95b3e48231ff8a81d047c68c (patch) | |
| tree | ba5a36fd786c79958d674254ba7f0f17df18bf12 | |
| parent | d40e6154a8080b92c6c69680425414e16fe4f742 (diff) | |
fixes #3709, fixes #3710, fixes #3712, fixes #3713
Closes #3709, #3710, #3712, and #3713
Merge request studip/studip!2610
| -rw-r--r-- | lib/classes/StudipPDO.class.php | 1 | ||||
| -rw-r--r-- | lib/classes/restapi/consumer/Base.php | 2 | ||||
| -rw-r--r-- | lib/models/PersonalNotifications.class.php | 2 | ||||
| -rw-r--r-- | lib/models/SimpleCollection.class.php | 7 | ||||
| -rw-r--r-- | lib/models/StudipNews.class.php | 5 | ||||
| -rw-r--r-- | lib/plugins/engine/PluginManager.class.php | 2 | ||||
| -rw-r--r-- | vendor/trails/trails.php | 3 |
7 files changed, 16 insertions, 6 deletions
diff --git a/lib/classes/StudipPDO.class.php b/lib/classes/StudipPDO.class.php index 08012b1..e77a37f 100644 --- a/lib/classes/StudipPDO.class.php +++ b/lib/classes/StudipPDO.class.php @@ -184,6 +184,7 @@ class StudipPDO extends PDO * @param mixed ...$fetch_args fetch mode parameters (see PDOStatement::setFetchMode) * @return object PDOStatement object */ + #[ReturnTypeWillChange] public function query($statement, $fetch_mode = NULL, ...$fetch_args) { $this->verify($statement); diff --git a/lib/classes/restapi/consumer/Base.php b/lib/classes/restapi/consumer/Base.php index 6272091..50f3150 100644 --- a/lib/classes/restapi/consumer/Base.php +++ b/lib/classes/restapi/consumer/Base.php @@ -108,7 +108,7 @@ abstract class Base extends \SimpleORMap $statement = DBManager::get()->query($query); $ids = $statement->fetchAll(PDO::FETCH_COLUMN); - return array_map('self::find', $ids); + return array_map([self::class, 'find'], $ids); } /** diff --git a/lib/models/PersonalNotifications.class.php b/lib/models/PersonalNotifications.class.php index efa44c1..721038c 100644 --- a/lib/models/PersonalNotifications.class.php +++ b/lib/models/PersonalNotifications.class.php @@ -107,7 +107,7 @@ class PersonalNotifications extends SimpleORMap $user_ids = [$user_ids]; } - $user_ids = array_filter($user_ids, 'self::isActivated'); + $user_ids = array_filter($user_ids, [self::class, 'isActivated']); if (!count($user_ids)) { return false; diff --git a/lib/models/SimpleCollection.class.php b/lib/models/SimpleCollection.class.php index 4228599..4d77682 100644 --- a/lib/models/SimpleCollection.class.php +++ b/lib/models/SimpleCollection.class.php @@ -154,7 +154,7 @@ class SimpleCollection extends StudipArrayObject case '%=': $comp_func = function ($a) use ($args) { $a = mb_strtolower(static::translitLatin1($a)); - $args = array_map('static::translitLatin1', $args); + $args = array_map([static::class, 'translitLatin1'], $args); $args = array_map('mb_strtolower', $args); return in_array($a, $args); }; @@ -256,7 +256,10 @@ class SimpleCollection extends StudipArrayObject */ public function exchangeArray($input) { - return parent::exchangeArray(array_map('static::arrayToArrayObject', $input)); + return parent::exchangeArray(array_map( + [static::class, 'arrayToArrayObject'], + $input + )); } /** diff --git a/lib/models/StudipNews.class.php b/lib/models/StudipNews.class.php index f909fb4..607f9d3 100644 --- a/lib/models/StudipNews.class.php +++ b/lib/models/StudipNews.class.php @@ -184,7 +184,10 @@ class StudipNews extends SimpleORMap implements PrivacyObject public static function GetNewsObjects($news_result) { - return array_map('static::buildExisting', (array) $news_result); + return array_map( + [static::class, 'buildExisting'], + (array) $news_result + ); } /** diff --git a/lib/plugins/engine/PluginManager.class.php b/lib/plugins/engine/PluginManager.class.php index bb8a563..be4f766 100644 --- a/lib/plugins/engine/PluginManager.class.php +++ b/lib/plugins/engine/PluginManager.class.php @@ -644,7 +644,7 @@ class PluginManager $plugin_info = $this->getPluginInfos($type); $plugins = []; - usort($plugin_info, ['self', 'positionCompare']); + usort($plugin_info, [self::class, 'positionCompare']); foreach ($plugin_info as $info) { $activated = $context == null diff --git a/vendor/trails/trails.php b/vendor/trails/trails.php index dc52019..b88a4a9 100644 --- a/vendor/trails/trails.php +++ b/vendor/trails/trails.php @@ -997,11 +997,13 @@ class Trails_Flash implements ArrayAccess { } + #[ReturnTypeWillChange] function offsetExists($offset) { return isset($this->flash[$offset]); } + #[ReturnTypeWillChange] function offsetGet($offset) { return $this->get($offset); } @@ -1012,6 +1014,7 @@ class Trails_Flash implements ArrayAccess { } + #[ReturnTypeWillChange] function offsetUnset($offset) { unset($this->flash[$offset], $this->used[$offset]); } |
