37 lines
982 B
PHP
37 lines
982 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Domain\Ports\Services;
|
|
|
|
use Domain\Contracts\CustomerDetails;
|
|
|
|
/** @template T of CustomerDetails */
|
|
interface CustomerAuthenticationService
|
|
{
|
|
public function canWithCustomer(\UnitEnum | string $abilities, mixed $arguments = []): bool;
|
|
|
|
/** @param T $customer */
|
|
public function logIn(CustomerDetails $customer): void;
|
|
|
|
public function logout(): void;
|
|
|
|
public function check(): bool;
|
|
|
|
public function guest(): bool;
|
|
|
|
/** @return T|null */
|
|
public function getCustomer(): ?CustomerDetails;
|
|
|
|
/** @return T */
|
|
public function getCustomerAsMandatory(): CustomerDetails;
|
|
|
|
/** @param T $customer */
|
|
public function resetPasswordFor(CustomerDetails $customer, string $password): bool | \Exception;
|
|
|
|
/** @param T $customer */
|
|
public function hasVerifiedEmail(CustomerDetails $customer): bool;
|
|
|
|
/** @param T $customer */
|
|
public function verifyEmail(CustomerDetails $customer): bool;
|
|
}
|