vatradar / vatsimclient
VATSIM Data Retriever
0.6.0
2023-03-08 21:35 UTC
Requires
- php: >=8.1
- cuyz/valinor: ^1.0
- guzzlehttp/guzzle: ^7.5
- vatradar/dataobjects: ^0.6
Requires (Dev)
- mockery/mockery: ^1.5
- phpstan/extension-installer: ^1.2
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-mockery: ^1.1
- phpstan/phpstan-phpunit: ^1.3
- phpstan/phpstan-strict-rules: ^1.4
- phpunit/phpunit: ^10.0
- psy/psysh: ^0
- roave/security-advisories: dev-latest
- spaze/phpstan-disallowed-calls: ^2.11
README
This module retrieves JSON data from VATSIM, does basic sanitization, and provides output in the form of a value object or raw JSON.
Quick Start
<?php require __DIR__.'/vendor/autoload.php'; use CuyZ\Valinor\MapperBuilder; use GuzzleHttp\Client as HttpClient; use VatRadar\DataObjects\Vatsim\VatsimData; use VatRadar\VatsimClient\DataFetcher; use VatRadar\VatsimClient\IterableSanitizer; use VatRadar\VatsimClient\Mapper; // Set up Dependencies $fetcher = new DataFetcher(new HttpClient(), 'https://status.vatsim.net/status.json'); $sanitizer = new IterableSanitizer(); $mapper = new Mapper(new MapperBuilder(), VatsimData::class); $client = new \VatRadar\VatsimClient\Client($fetcher, $sanitizer, $mapper); $vatsimDataObject = $client->retrieve();