Skip to content
This repository has been archived by the owner on Jul 30, 2023. It is now read-only.

ElGovanni/weather-api

Repository files navigation

Weather api

This application integrates Musement's API with WeatherApi

example workflow

Requirements

Installation

To install application you have to execute few commands

git clone [email protected]:ElGovanni/weather-api.git
cd weather-api

Install composer dependencies

docker-compose run --rm composer install

Configuration

For proper operation of the application, you need to add an environment variable with your WeatherApi key using command below but with your key instead of <YOUR_API_KEY>.

echo "WEATHER_API_KEY=<YOUR_API_KEY>" > .env.local

Or if you want to avoid bash just create new file .env.local with WEATHER_API_KEY=<YOUR_API_KEY> in root project directory.

Usage

To display forecast for cities from Musement's API execute below command inside php container

docker-compose run --rm php bin/console app:forecast

You can change default 2 days of forecast to other in range 1:3 by using argument days, for example:

docker-compose run --rm php bin/console app:forecast 3

Tests

You should enter into docker php container using command below before you are going to execute rest of test commands below.

Unit

Master branch tests coverage report is available on project github page

docker-compose run --rm php bin/phpunit

Execute this to run tests and generate coverage report.

docker-compose run --rm php bin/phpunit --coverage-html var/coverage-report

Coding standard

Below command check coding standards in src and tests directory.

docker-compose run --rm php ./vendor/bin/ecs check

Static code analysis

Static analysis using PHPStan tool to find errors before run app.

docker-compose run --rm php ./vendor/bin/phpstan analyse

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published