https://github.com/thecodingmachine/weatherapi-service-provider
Cross-framework module for thecodingmachine/weatherapi
https://github.com/thecodingmachine/weatherapi-service-provider
Last synced: 3 months ago
JSON representation
Cross-framework module for thecodingmachine/weatherapi
- Host: GitHub
- URL: https://github.com/thecodingmachine/weatherapi-service-provider
- Owner: thecodingmachine
- Created: 2016-10-20T13:54:37.000Z (over 9 years ago)
- Default Branch: 1.0
- Last Pushed: 2017-01-05T21:30:34.000Z (over 9 years ago)
- Last Synced: 2025-02-16T12:30:31.337Z (over 1 year ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WeatherApi universal module
This package integrates the WeatherApi demo package in any [container-interop](https://github.com/container-interop/service-provider) compatible framework/container.
## Installation
```
composer require thecodingmachine/weatherapi-service-provider
```
Once installed, you need to register the [`TheCodingMachine\WeatherApi\WeatherApiServiceProvider`](src/WeatherApiServiceProvider.php) into your container.
If your container supports Puli integration, you have nothing to do. Otherwise, refer to your framework or container's documentation to learn how to register *service providers*.
## Introduction
This service provider is meant to create a `WeatherApi` service in your container.
This is part of a [demo for a talk at Paris ForumPHP 2016](https://thecodingmachine.github.io/forumphp2016talk/) and is not meant to be used in production.
## Expected values / services
This *service provider* expects the following configuration / services to be available:
| Name | Compulsory | Description |
|-----------------------------|------------|----------------------------------------|
| `Http\Client\HttpClient` | *yes* | A service providing a HTTPlug HttpClient |
| `Psr\Log\LoggerInterface` | *yes* | A PSR-3 logger |
| `Psr\Cache\CacheItemPoolInterface` | *yes* | A PSR-6 cache |
| `openWeatherMapApiKey` | *yes* | An API key from OpenWeatherMap.com |
## Provided services
This *service provider* provides the following services:
| Service name | Description |
|-----------------------------|--------------------------------------|
| `TheCodingMachine\WeatherApi\WeatherApi` | The WeatherApi service |
## Extended services
*None*
Project template courtesy of thecodingmachine/service-provider-template