<?php

	namespace Icing\Policy;

	use Authorization\Policy\ResolverInterface;
	use Authorization\Policy\Exception\MissingPolicyException;

    class StringResolver implements ResolverInterface
	{
		public function getPolicy($resource): IcingPermissionsPolicy
        {
			if (is_scalar($resource)) {
				return new IcingPermissionsPolicy();
			}
			if (is_scalar($resource)) {
				$resource = "Policy for '$resource' has not been defined.";
			}
			throw new MissingPolicyException($resource);
		}
	}
