comsave/salesforce-outbound-message-tower

View on GitHub
src/Services/Validator/MessageNotificationIdValidator.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php
 
namespace App\Services\Validator;
 
use App\Exception\OutboundMessageTowerException;
 
class MessageNotificationIdValidator
{
public function validate(?string $notificationId): bool
{
if (!preg_match('/^[a-z0-9]{15,18}$/i', $notificationId)) {
throw new OutboundMessageTowerException('Invalid: `notificationId`.');
}
 
return true;
}
}