Simplify UserFormField's form data processor using `\array_column()`
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 25 Aug 2021 11:32:55 +0000 (13:32 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 25 Aug 2021 11:32:55 +0000 (13:32 +0200)
wcfsetup/install/files/lib/system/form/builder/field/user/UserFormField.class.php

index 6a6be22c9fa63adcb13bf0e732f28426fd540ce4..ee08fe3acde36156fa810e92d0758bd4a4931478 100644 (file)
@@ -95,11 +95,7 @@ class UserFormField extends AbstractFormField implements
                 'multipleUsers',
                 function (IFormDocument $document, array $parameters) {
                     if ($this->checkDependencies()) {
-                        $parameters[$this->getObjectProperty()] = \array_values(
-                            \array_map(static function (UserProfile $user) {
-                                return $user->userID;
-                            }, $this->getUsers())
-                        );
+                        $parameters[$this->getObjectProperty()] = \array_column($this->getUsers(), 'userID');
                     }
 
                     return $parameters;