jeppos / skanetrafiken-php-api-client
A simple Skånetrafiken PHP API client.
v0.1.0
2017-05-13 10:47 UTC
Requires
- php: ^7.1
- consistence/consistence-jms-serializer: ^1.0
- doctrine/common: ^2.7
- guzzlehttp/guzzle: ^6.2
- jms/serializer: ^1.6
Requires (Dev)
- codacy/coverage: ^1.1
- phpmd/phpmd: ^2.6
- phpunit/phpunit: ^6.1
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2025-03-21 03:49:32 UTC
README
A simple Skånetrafiken PHP API client.
Installation
Composer
composer require jeppos/skanetrafiken-php-api-client
Usage
Following example shows how to get upcoming departures from Malmö C.
use Jeppos\SkanetrafikenApiClient\SerializerFactory; use Jeppos\SkanetrafikenApiClient\Service\DepartureBoard; $guzzleClient = new \GuzzleHttp\Client([ 'base_uri' => 'http://www.labs.skanetrafiken.se/v2.2/' // Version 2.2 of Skånetrafiken API ]); $departureBoard = new DepartureBoard($guzzleClient, SerializerFactory::create()); $departureBoard->setStopAreaId(80000); // 80000 = Malmö C $departureBoard->call(); $response = $departureBoard->getResponse();