Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Placeholder Value - Update README.md #15

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
```

Expand Down
Loading