<?php

namespace NoahVet\Reef\Security\Policy;

use NoahVet\Reef\Domain\Security\Model\Resource;
use NoahVet\Reef\Domain\Security\Model\ResourceType;

/**
 * @deprecated Use \NoahVet\Reef\Domain\Security\Policy\PolicyResult instead
 */
class PolicyResult extends \NoahVet\Reef\Domain\Security\Policy\PolicyResult
{
    public function __construct(
        string $policyName,
        string $subject,
        ResourceType $resourceType,
    ) {
        parent::__construct($policyName, Resource::fromString($resourceType, $subject));

        $this->policyName = $policyName;
    }

    public function getResourceType(): ResourceType
    {
        return $this->subject->getResourceType();
    }
}
