Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
UnsealException
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
 __toString
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace Fingerprint\ServerSdk\Sealed;
4
5class UnsealException extends \Exception
6{
7    public string $decryptionKeyDescription;
8
9    public function __construct($message, $cause, DecryptionKey $decryptionKey)
10    {
11        parent::__construct($message, 0, $cause);
12        $key = $decryptionKey->getKey();
13        $this->decryptionKeyDescription = substr($key, 0, 3).'***'.substr($key, -3);
14    }
15
16    public function __toString(): string
17    {
18        return 'UnsealException{'
19            .'decryptionKey='.$this->decryptionKeyDescription
20            .', message='.$this->getMessage()
21            .', cause='.$this->getPrevious()
22            .'}';
23    }
24}