From ff48b1b2471699fd2c896cf021a9ac5b9b4f27b8 Mon Sep 17 00:00:00 2001 From: Miljan Ilic Date: Fri, 15 Mar 2024 12:34:40 +0100 Subject: [PATCH] Update README.md --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8f59906..624d0a5 100644 --- a/README.md +++ b/README.md @@ -35,17 +35,22 @@ Ensure that your `composer.json` file is updated and the library is included in ### Marking Properties for Encryption -Use the `#[Encrypted]` attribute to mark properties within your classes that you wish to encrypt or decrypt. For example: +Use the `#[Encrypted]` attribute to mark properties for encryption. This attribute supports an optional `placeholder` +parameter for customizable decryption failure handling. + +When decryption fails, and a `placeholder` is provided, that value is used instead. If the placeholder is null, +an exception may be thrown. ```php use IlicMiljan\SecureProps\Attribute\Encrypted; class User { - #[Encrypted] + #[Encrypted(placeholder: "***-**-****")] private string $socialSecurityNumber; - // Other properties and methods... + #[Encrypted] + private string $secretNote; } ```