UserInsert final readonly class
Minn\Runtime\UserInsert · public/minn/src/Minn/Runtime/UserInsert.php · 122 lines
The decisions behind wp_insert_user: what a new account needs, which email and login collide, the resolved profile fields, and which columns an update changes. The sanitisers and lookups arrive as closures so the reference's filters apply. Behaviour pinned by contracts/fixtures/api/functions.json.
Constants and properties
| const | META_KEYS = array ( 0 => 'nickname', 1 => 'first_name', 2 => 'last_name', 3 => 'description', 4 => 'rich_editing', 5 => 'syntax_highlighting', 6 => 'comment_shortcuts', 7 => 'admin_color', 8 => 'use_ssl', 9 => 'show_admin_bar_front', 10 => 'locale', ) | |
| private | readonly Closure $sanitizeLogin | Promoted from the constructor. |
| private | readonly Closure $sanitizeSlug | Promoted from the constructor. |
| private | readonly Closure $isEmail | Promoted from the constructor. |
| private | readonly Closure $loginTaken | Promoted from the constructor. |
| private | readonly Closure $emailOwner | Promoted from the constructor. |
| private | readonly Closure $roleExists | Promoted from the constructor. |
Public
| new | __construct(Closure $sanitizeLogin, Closure $sanitizeSlug, Closure $isEmail, Closure $loginTaken, Closure $emailOwner, Closure $roleExists)# |
| ||||||||||||||||||
| method | resolve(array $userdata, ?array $existing): Minn\Runtime\Refusal|array# | The validated, resolved fields, or the refusal the reference gives.
@return array{login: string, email: string, nicename: ?string, display_name: string, role: ?string}|Refusal | ||||||||||||||||||
| static | account(array $userdata, array $resolved, string $defaultRole): array# | The fields a new account is created from. @param array{login: string, email: string, nicename: ?string, display_name: string, role: ?string} $resolved @return array<string, mixed>
| ||||||||||||||||||
| static | changes(array $userdata, array $existing, array $resolved, Closure $url, Closure $hash): array# | The columns an update actually changes.
@return array<string, string> |
Nothing matches.