<?php
namespace Fifa\ConnectId\Sdk\ActorResolver;

/**
 * Class SimpleActorResolver
 * Default implementation of ActorResolverInterface. Always returns actor provided as a parameter of the constructor.
 * @package Fifa\ConnectId\Sdk\ActorResolver
 */
class SimpleActorResolver implements ActorResolverInterface
{
    /**
     * @var string
     */
    private $actor;

    /**
     * SimpleActorResolver constructor.
     * @param string $actor
     */
    public function __construct(string $actor)
    {
        $this->actor = $actor;
    }

    /**
     * Returns name or identifier of actor
     * @return string
     */
    public function resolve(): string
    {
        return $this->actor;
    }

    /**
     * @return SimpleActorResolver
     */
    public static function emptyActor(): SimpleActorResolver
    {
        return new SimpleActorResolver('');
    }
}