mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
43 lines
967 B
PHP
43 lines
967 B
PHP
<?php
|
|
|
|
namespace App\Classes\Modules\Accounts\Standards\Criteria;
|
|
|
|
|
|
use App\Classes\Exceptions\MalformedRequestException;
|
|
use App\Classes\Exceptions\ResourceNotFoundException;
|
|
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
|
use App\Models\User;
|
|
use App\Models\UserEmailVerification;
|
|
|
|
class UnverifiedUserEmail
|
|
{
|
|
|
|
/** @var User */
|
|
private $repository;
|
|
|
|
/**
|
|
* TokenExistsValidation constructor.
|
|
* @param UserEmailVerification $repository
|
|
*/
|
|
public function __construct(UserEmailVerification $repository)
|
|
{
|
|
$this->repository = $repository;
|
|
}
|
|
|
|
|
|
/**
|
|
* @param string $token
|
|
* @return bool
|
|
* @throws MalformedRequestException
|
|
*/
|
|
public function execute(string $user){
|
|
|
|
if(!$this->repository->status === ApprovalStatus::PENDING_VERIFICATION){
|
|
throw new MalformedRequestException('The user email address has been verified already');
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} |