Download the PHP package reynevan/imgw-php without Composer
On this page you can find all versions of the php package reynevan/imgw-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download reynevan/imgw-php
More information about reynevan/imgw-php
Files in reynevan/imgw-php
Package imgw-php
Short Description A lightweight, fully typed PHP client for the public IMGW API
License MIT
Informations about the package imgw-php
imgw-php
A lightweight, fully typed PHP client for the public IMGW API (danepubliczne.imgw.pl) - synoptic and hydrological station data plus meteorological and hydrological warnings, mapped directly onto DTO objects.
Features
- Synoptic (
synop) and meteorological (meteo) station data - Hydrological station data (
hydro) - Hydrological (
warningshydro) and meteorological (warningsmeteo) warnings - API responses mapped onto strongly typed DTOs via PHP attributes (
#[ApiField]) - Decoupled from any specific HTTP client thanks to PSR-18 (
php-http/discoveryauto-detects an available client) - 100% test coverage
Requirements
- PHP >= 8.1
- A PSR-18 (
psr/http-client-implementation) and PSR-17 (psr/http-factory-implementation) implementation, e.g.guzzlehttp/guzzle+guzzlehttp/psr7orsymfony/http-client+nyholm/psr7
Installation
If your project doesn't have a PSR-18 client yet, install one, e.g. Guzzle:
Quick start
Synoptic data (Synop)
Hydrological data (Hydro)
Meteorological data (Meteo)
Hydrological warnings (WarningsHydro)
Meteorological warnings (WarningsMeteo)
Custom HTTP client
ImgwClient optionally accepts a custom HttpClientInterface implementation - useful for plugging in a PSR-18 client with custom configuration (timeouts, headers, middleware) or for testing.
Error handling
Connection errors and API responses with a status >= 400 are thrown as Reynevan\Imgw\Exceptions\ImgwApiException.
Testing
License
MIT
All versions of imgw-php with dependencies
psr/http-client Version ^1.0
psr/http-client-implementation Version ^1.0
psr/http-factory Version ^1.0
psr/http-factory-implementation Version ^1.0
psr/http-message Version ^1.0 || ^2.0
php-http/discovery Version ^1.19