for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\User\CurrentIdentity;
use Psr\EventDispatcher\EventDispatcherInterface;
use Yiisoft\Auth\IdentityInterface;
use Yiisoft\Auth\IdentityRepositoryInterface;
final class CurrentIdentity
{
private ?IdentityInterface $identity = null;
$identity
private IdentityRepositoryInterface $identityRepository;
private EventDispatcherInterface $eventDispatcher;
public function __construct(
IdentityRepositoryInterface $identityRepository,
EventDispatcherInterface $eventDispatcher
) {
$this->identityRepository = $identityRepository;
$this->eventDispatcher = $eventDispatcher;
}