kenjidev / yousign
Requires
- php: ^7.4|^8.0
- ext-json: ^7.4|^8.0
- doctrine/annotations: ^1.10
- guzzlehttp/guzzle: >=6.0
- symfony/property-access: ^6.4
- symfony/property-info: ^6.4
- symfony/serializer: ^6.4
Requires (Dev)
- brainmaestro/composer-git-hooks: ^2.8
- friendsofphp/php-cs-fixer: ^2.18
- phpmd/phpmd: ^2.9
- phpstan/phpstan: ^0.12.31
- phpunit/phpunit: ^9.1
- sebastian/phpcpd: ^6.0
This package is auto-updated.
Last update: 2025-05-11 11:40:02 UTC
README
easyblue/easy-yousign
easy-yousign
provide an easy way to use YouSign API. Modern, tested and fully written in php.
Written here at easyblue.io, a french insurtech company. Check out our website to see how we're using this package in production.
Installation
Install this package as a dependency using Composer.
composer require easyblue/easy-yousign
Usage
Procedure
and File
are supporting for basic mode but you can do a pull request to improve this library.
Create procedure
use Easyblue\YouSign\Factory\Factory; use Easyblue\YouSign\Model\File; use Easyblue\YouSign\Model\FileObject; use Easyblue\YouSign\Model\Member; use Easyblue\YouSign\Model\Procedure; use Easyblue\YouSign\Http\Client; $ysApiKey = 'test'; $factory = new Factory($ysApiKey, Client::ENV_STAGING); $member = (new Member()) ->setFirstname('John') ->setLastname('Doe') ->setEmail('j.doe@domain.com') ->setPhone('+33611111111'); $file = (new File()) ->setName('my_file.pdf') ->setContent('base64 content'); $file = $factory->file()->create(); $fileObject = (new FileObject()) ->setFile($file) ->setPage(1) ->setPosition('230,499,464,589'); $member->addFileObject($fileObject); $procedure = (new Procedure())->setName('My first procedure') ->setDescription('Awesome! Here is the description of my first procedure') ->addMember($member); $procedure = $factory->procedure()->create($procedure);
Get procedure
use Easyblue\YouSign\Factory\Factory; use Easyblue\YouSign\Model\Procedure; use Easyblue\YouSign\Http\Client; $ysApiKey = 'test'; $factory = new Factory($ysApiKey, Client::ENV_STAGING); /** Procedure $procedure **/ $procedure = $factory->procedure()->get('/procedures/9d1ede2b-5687-4440-bdc8-dd0bc64f668c');
Download file
use Easyblue\YouSign\Factory\Factory; use Easyblue\YouSign\Model\File; use Easyblue\YouSign\Http\Client; $ysApiKey = 'test'; $factory = new Factory($ysApiKey/*, Client::ENV_STAGING*/); // Pdf content as binary file $content = $factory->file()->download('/files/9d1ede2b-5687-4440-bdc8-dd0bc64f668c'); // Pdf content as base64 $content = $factory->file()->download('/files/9d1ede2b-5687-4440-bdc8-dd0bc64f668c', false);
Framework
Contributing
Contributions are welcome! Before contributing to this project, familiarize yourself with CONTRIBUTING.md.
To develop this project, you will need PHP 7.4 or greater, Composer and make.
After cloning this repository locally, execute the following commands:
cd /path/to/repository
composer install
Now, you are ready to develop!
Coding Standards
This project follows a superset of PSR-12
coding standards, enforced by PHP-CS-Fixer.
The project PHP_CodeSniffer configuration may be found in .php_cs
.
You may lint the entire codebase using PHP-CS-Fixer with the following commands:
make php-cs-fixer
Static Analysis
This project uses a combination of PHPStan, phpmd, phpcpd to provide static analysis of PHP
code. Configurations for these are in phpstan.neon.dist
, .phpmd.xml
.
respectively.
You may run static analysis manually across the whole codebase with the following command:
# Static analysis
make phpspan
make phpmd
make phpcpd
Pre-commit
This project use composer-git-hooks. It will attempt to fix any errors it can, and it will reject the commit if there are any un-fixable issues. Many issues can be fixed automatically and will be done so pre-commit.
Register pre-commit at first usage
vendor/bin/cghooks add
Project Structure
This project uses pds/skeleton as its base folder structure and layout.
Name | Description |
---|---|
bin/ | Commands and scripts for this project |
build/ | Cache, logs, reports, etc. for project builds |
docs/ | Project-specific documentation |
resources/ | Additional resources for this project |
src/ | Project library and application source code |
tests/ | Tests for this project |
Copyright and License
The easyblue/easy-yousign library is copyright © easyblue and licensed for use under the terms of the MIT License (MIT). Please see LICENSE for more information.