jenky / jsonplaceholder
JSON Placeholder SDK
dev-main
2024-03-10 13:45 UTC
Requires
- php: ^8.1
- cuyz/valinor: ^1.9
- fansipan/fansipan: ^1.0
- guzzlehttp/guzzle: ^7.7
- ramsey/collection: ^2.0
Requires (Dev)
- fansipan/mock-client: ^1.0
- friendsofphp/php-cs-fixer: ^3.10
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-11-10 15:11:40 UTC
README
This repository serves as a demonstration of how you can build your SDK/integration with JsonPlaceholder service using Fansipan library.
Installation
You can install the package via composer:
composer require jenky/jsonplaceholder
Usage
Create new SDK instance
$sdk = new Jenky\JsonPlaceholder();
Get list of users
// GET https://jsonplaceholder.typicode.com/users $sdk->users()->get(); // GET https://jsonplaceholder.typicode.com/users?_limit=5 $sdk->users()->get(limit: 5); // GET https://jsonplaceholder.typicode.com/users?_page=2 $sdk->users()->get(page: 2);
Get an user by ID
// GET https://jsonplaceholder.typicode.com/users/1 $sdk->users()->id(1)->find();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email contact@lynh.me instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.