swisnl/melvin

NDW Melvin API client

1.4.1 2024-04-05 07:10 UTC

This package is auto-updated.

Last update: 2024-04-23 15:06:52 UTC


README

Latest Version on Packagist Software License Buy us a tree Build Status Integration Tests Status Coverage Status Quality Score Total Downloads Made by SWIS

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.