Refactor AddressBookRevokeSignature and ContactManager to remove UUID validation and improve error handling
https://github.com/nosial/Socialbox-PHP/issues/36
This commit is contained in:
parent
50c638b534
commit
eadf1cd3a4
2 changed files with 12 additions and 12 deletions
|
@ -7,6 +7,7 @@
|
|||
use ncc\ThirdParty\Symfony\Uid\UuidV4;
|
||||
use PDO;
|
||||
use PDOException;
|
||||
use Socialbox\Classes\Cryptography;
|
||||
use Socialbox\Classes\Database;
|
||||
use Socialbox\Classes\Validator;
|
||||
use Socialbox\Enums\Types\ContactRelationshipType;
|
||||
|
@ -424,6 +425,15 @@
|
|||
{
|
||||
$contactUuid = $contactUuid->getUuid();
|
||||
}
|
||||
elseif(!Validator::validateUuid($contactUuid))
|
||||
{
|
||||
throw new InvalidArgumentException('The given contact UUID is not a valid UUID V4');
|
||||
}
|
||||
|
||||
if(!Validator::validateUuid($signatureUuid))
|
||||
{
|
||||
throw new InvalidArgumentException('The given signature UUID is not a valid UUID V4');
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue