-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Decryption Failure Handling
- Loading branch information
1 parent
58a1b64
commit a535452
Showing
2 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace IlicMiljan\SecureProps\Exception; | ||
|
||
use RuntimeException; | ||
use Throwable; | ||
|
||
class SingleEncryptedAttributeExpected extends RuntimeException implements EncryptionServiceException | ||
{ | ||
public function __construct( | ||
private int $count, | ||
?Throwable $previous = null | ||
) { | ||
parent::__construct( | ||
'Each property must be annotated with a single instance of the Encrypted attribute.', | ||
0, | ||
$previous | ||
); | ||
} | ||
|
||
public function getCount(): int | ||
{ | ||
return $this->count; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters