mirror of
https://github.com/flarum/framework.git
synced 2025-01-21 14:14:59 +08:00
array_build => array_map
This commit is contained in:
parent
3eede757bb
commit
d7306dedb7
|
@ -484,9 +484,9 @@ class User extends AbstractModel
|
|||
*/
|
||||
public function getPreferencesAttribute($value)
|
||||
{
|
||||
$defaults = array_build(static::$preferences, function ($key, $value) {
|
||||
return [$key, $value['default']];
|
||||
});
|
||||
$defaults = array_map(function ($value) {
|
||||
return $value['default'];
|
||||
}, static::$preferences);
|
||||
|
||||
$user = array_only((array) json_decode($value, true), array_keys(static::$preferences));
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user