src/MessageValidators/ResourceMessageValidator.php
<?php
namespace Packback\Lti1p3\MessageValidators;
use Packback\Lti1p3\LtiConstants;
use Packback\Lti1p3\LtiException;
class ResourceMessageValidator extends AbstractMessageValidator
{
public static function getMessageType(): string
{
return LtiConstants::MESSAGE_TYPE_RESOURCE;
}
/**
* @throws LtiException
*/
public static function validate(array $jwtBody): void
{
static::validateGenericMessage($jwtBody);
if (empty($jwtBody[LtiConstants::RESOURCE_LINK]['id'])) {
throw new LtiException('Missing Resource Link Id');
}
}
}