Using the "WordPress" style, or manually checking virtually every "add spacing" in the formatter, there doesn't appear a way to add spaces around params in inline closures. I think this should probably inherit / take the value of php.format.rules.spaceWithinDeclParens
register_rest_field( 'user', 'has_responded_to_personal_data_collection', [
'get_callback' => function (array $item) : ?bool {
// Only add a token if this is the current user.
if ( get_current_user_id() !== $item['id'] ) {
return null;
}
return (bool) get_user_meta( $item['id'], 'has_responded_to_personal_data_collection', true );
},
'update_callback' => function (bool $value, WP_User $user) : void {
update_user_meta( $user->ID, 'has_responded_to_personal_data_collection', $value );
},
'schema' => [
'description' => 'Whether the user has responded to a request to share personal information for data collection purposes.',
'type' => 'bool',
],
] );
Using the "WordPress" style, or manually checking virtually every "add spacing" in the formatter, there doesn't appear a way to add spaces around params in inline closures. I think this should probably inherit / take the value of
php.format.rules.spaceWithinDeclParens