52 lines
1.1 KiB
PHP
52 lines
1.1 KiB
PHP
<?php
|
|
|
|
/**
|
|
* UserProviderInterface defines contract for user storage providers
|
|
*/
|
|
interface UserProviderInterface
|
|
{
|
|
/**
|
|
* Find user by ID
|
|
*/
|
|
public function findById(int|string $id): ?User;
|
|
|
|
/**
|
|
* Find user by email
|
|
*/
|
|
public function findByEmail(string $email): ?User;
|
|
|
|
/**
|
|
* Find user by username
|
|
*/
|
|
public function findByUsername(string $username): ?User;
|
|
|
|
/**
|
|
* Find user by credentials (email or username)
|
|
*/
|
|
public function findByCredentials(string $identifier): ?User;
|
|
|
|
/**
|
|
* Find user by remember token
|
|
*/
|
|
public function findByRememberToken(string $token): ?User;
|
|
|
|
/**
|
|
* Create a new user
|
|
*/
|
|
public function create(array $data): User;
|
|
|
|
/**
|
|
* Update user data
|
|
*/
|
|
public function update(User $user, array $data): bool;
|
|
|
|
/**
|
|
* Update remember token
|
|
*/
|
|
public function updateRememberToken(User $user, ?string $token): bool;
|
|
|
|
/**
|
|
* Verify user password
|
|
*/
|
|
public function verifyPassword(User $user, string $password): bool;
|
|
} |