Skip to content

Commit e4ed1a3

Browse files
authored
Merge pull request #22 from JMLamodiere/fix_accuweather_in_doc
be more specific about using AccuWeather in Infra and fix README
2 parents b2315b4 + 9c1ee0d commit e4ed1a3

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ Pre-requisites (see [composer.json](composer.json)) :
8181
- ext-pgsql
8282
- [Symfony local web server](https://symfony.com/doc/current/setup/symfony_server.html)
8383

84-
Create an account on [OpenWeatherMap](https://home.openweathermap.org/api_keys) and copy your api key:
84+
Create an App on [AccuWeather](https://developer.accuweather.com/) and copy your API Key:
8585

8686
```
8787
# in /.env.dev.local
88-
OPENWEATHER_API_KEY=xxx
88+
ACCUWEATHER_API_KEY=xxx
8989
```
9090

9191
Start local dev environment with:

config/services.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ services:
3838
arguments:
3939
- base_uri: '%env(ACCUWEATHER_BASE_URI)%'
4040

41-
App\Infrastructure\Http\RestWeatherProvider:
41+
App\Infrastructure\Http\HttpAccuWeatherProvider:
4242
arguments:
4343
$client: '@guzzle.accuweather'
4444
$apiKey: '%env(ACCUWEATHER_API_KEY)%'

src/Infrastructure/Http/RestWeatherProvider.php renamed to src/Infrastructure/Http/HttpAccuWeatherProvider.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
use GuzzleHttp\Client;
1010
use GuzzleHttp\Exception\GuzzleException;
1111

12-
class RestWeatherProvider implements WeatherProvider
12+
class HttpAccuWeatherProvider implements WeatherProvider
1313
{
14+
// See https://developer.accuweather.com/accuweather-current-conditions-api/apis
1415
public const CURRENT_CONDITION_URI = 'currentconditions/v1/%d?apikey=%s';
1516
public const LOCATION_KEY_PARIS = 623;
1617

tests/Infrastructure/Http/RestWeatherProviderTest.php renamed to tests/Infrastructure/Http/HttpAccuWeatherProviderTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
/**
1313
* @group integration
1414
*/
15-
class RestWeatherProviderTest extends TestCase
15+
class HttpAccuWeatherProviderTest extends TestCase
1616
{
17-
private RestWeatherProvider $provider;
17+
private HttpAccuWeatherProvider $provider;
1818
private WireMock $wireMock;
1919
private string $currentConditionUri;
2020

@@ -25,7 +25,7 @@ protected function setUp(): void
2525
$host = 'wiremock';
2626
$port = '8080';
2727

28-
$this->provider = new RestWeatherProvider(
28+
$this->provider = new HttpAccuWeatherProvider(
2929
// See https://docs.guzzlephp.org/en/stable/quickstart.html#creating-a-client
3030
new Client(['base_uri' => "http://$host:$port/"]),
3131
$accuweatherApiKey,

0 commit comments

Comments
 (0)