district5/mondoc-encryption

Mondoc encryption provides the encrypt/decrypt functionality for Mondoc.

1.0.2 2025-05-16 07:35 UTC

This package is auto-updated.

Last update: 2025-05-16 08:08:38 UTC


README

CI Latest Stable Version PHP Version Require Codecov

FOSSA Status

Provides the encryption function to Mondoc

Installing with composer

Mondoc Encryption is used by, and leverages functionality from, the Mondoc library. You will need to install Mondoc in order to use Mondoc Encryption.

composer require district5/mondoc

Documentation...

All documentation for Mondoc Encryption, Mondoc, and Mondoc Builder are available at mondoc.district5.dev.

Common topics...

Testing

You can run PHPUnit against the library by running composer install and then running ./vendor/bin/phpunit

Creating a new encryption adapter

To create a new encryption adapter, you need to implement the EncryptionAdapterInterface interface, which requires the following methods:

    /**
     * Encrypt the field value.
     */
    public function encrypt(string $field, mixed $value): mixed;
    
    /**
     * Decrypt the field value.
     */
    public function decrypt(string $field, mixed $value): mixed;