arnapou / owmclient
Library - OpenWeatherMap Api client.
v2.0
2023-11-25 18:33 UTC
Requires
- php: ~8.3.0
- arnapou/dto: ^3.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
Requires (Dev)
- arnapou/psr: ^2.0
- friendsofphp/php-cs-fixer: ^3.39
- phpstan/phpstan: ^1.10
- phpunit/php-code-coverage: ^10.1
- phpunit/phpunit: ^10.4
This package is auto-updated.
Last update: 2023-11-25 18:33:38 UTC
README
This library is a simple tool to query OpenWeatherMap Api.
Installation
composer require arnapou/owmclient
packagist 👉️ arnapou/owmclient
Example
Simply call and use either raw array, either recommended typed objects (the purpose of this lib).
use Arnapou\OwmClient\OwmApiClient;
use Http\Discovery\Psr17Factory;
use Http\Discovery\Psr18Client;
$client = new OwmApiClient("API_KEY", new Psr18Client(), new Psr17Factory());
$onecall = $client->onecall(longitude: 48.86, latitude: 2.23);
var_dump($onecall->daily->getItem(0)->temp->max);
// float(23.5)
Changelog versions
Start | Tag, Branch | Php |
---|---|---|
25/11/2023 | 2.x, main | 8.3 |
03/09/2023 | 1.x | 8.2 |