swisnl / melvin
NDW Melvin API client
Installs: 2 005
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- php: ^8.1
- ext-json: *
- jmikola/geojson: ^1.0
- myclabs/php-enum: ^1.8
- php-http/discovery: ^1.8
- psr/http-client-implementation: ^1.0
- psr/http-factory-implementation: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.3
- guzzlehttp/guzzle: ^7.3
- guzzlehttp/psr7: ^2.0
- opis/json-schema: ^2.3
- phpunit/phpunit: ^10.5
- swisnl/php-http-fixture-client: ^3.0
README
This is a (slightly opinionated) client for the Melvin API by NDW. Please note that the Melvin API requires authentication, and we can't provide you with credentials.
Install
Via Composer
composer require swisnl/melvin
N.B. Make sure you have installed a PSR-18 HTTP Client and PSR-17 HTTP Factories before you install this package or install one at the same time e.g. composer require swisnl/json-api-client guzzlehttp/guzzle:^7.3
.
HTTP Client
We are decoupled from any HTTP messaging client with the help of PSR-18 HTTP Client and PSR-17 HTTP Factories.
This requires an extra package providing psr/http-client-implementation and psr/http-factory-implementation.
To use Guzzle 7, for example, simply require guzzlehttp/guzzle
:
composer require guzzlehttp/guzzle:^7.3
Usage
use Swis\Melvin\Client; use Swis\Melvin\SituationFilterParameters; $client = Client::create('username', 'password'); $params = (new SituationFilterParameters())->setAreaIds([409]); $situations = $client->situations()->export($params); foreach ($situations as $situation) { // Do stuff with the situation }
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
composer test
Contributing
Please see CONTRIBUTING and CODE_OF_CONDUCT for details.
Security
If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
This package is Treeware. If you use it in production, then we ask that you buy the world a tree to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.
SWIS ❤️ Open Source
SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.