src/mako/gatekeeper/authorization/Authorizer.php
protected function policyFactory($entity): PolicyInterface
	{
		$entityClass = is_object($entity) ? get_class($entity) : $entity;

		if(!isset($this->policies[$entityClass]))
		{
			throw new AuthorizerException(vsprintf('There is no authorization policy registered for [ %s ] entities.', [$entityClass]));
		}

		return $this->container->get($this->policies[$entityClass]);
	}
protected function policyFactory($entity): PolicyInterface
	{
		$entityClass = is_object($entity) ? get_class($entity) : $entity;

		if(!isset($this->policies[$entityClass]))
		{
			throw new AuthorizerException(vsprintf('There is no authorization policy registered for [ %s ] entities.', [$entityClass]));
		}

		return $this->container->get($this->policies[$entityClass]);
	}
protected function policyFactory ( $ entity ) : PolicyInterface { $ entityClass = is_object ( $ entity ) ? get_class ( $ entity ) : $ entity ; if ( ! isset ( $ this -> policies [ $ entityClass ] ) ) { throw new AuthorizerException ( vsprintf ( 'There is no authorization policy registered for [ %s ] entities.' , [ $ entityClass ] ) ) ; } return $ this -> container -> get ( $ this -> policies [ $ entityClass ] ) ; }
Policy factory.

@param  object|string                                           $entity Entity instance or class name
@throws \mako\gatekeeper\authorization\AuthorizerException
@return \mako\gatekeeper\authorization\policies\PolicyInterface
Policy factory .