Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
Add Laravel 7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-ivanov committed Mar 16, 2020
1 parent f7a1660 commit 5bacbb8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0 (16 Mar 2020)](https://github.com/dmitry-ivanov/dark-sky-api/compare/1.1.2...1.2.0)
### Added
- Laravel 7 support.

## [1.1.2 (24 Feb 2020)](https://github.com/dmitry-ivanov/dark-sky-api/compare/1.1.1...1.1.2)
### Fixed
- PSR-12 related fixes, small refactorings
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
"require": {
"php": ">=5.6",
"ext-json": "*",
"guzzlehttp/guzzle": "^6.3",
"guzzlehttp/guzzle": "^6.3|^7.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"illuminate/contracts": "^5.1|^6.0",
"illuminate/support": "^5.1|^6.0",
"illuminate/contracts": "^5.1|^6.0|^7.0",
"illuminate/support": "^5.1|^6.0|^7.0",
"mockery/mockery": "^0.9|^1.0",
"phpunit/phpunit": "^4.0|^5.0|^6.0|^7.0|^8.0",
"vlucas/phpdotenv": "^3.3"
"phpunit/phpunit": "^4.0|^5.0|^6.0|^7.0|^8.0|^9.0"
},
"autoload": {
"files": [
Expand Down
65 changes: 65 additions & 0 deletions tests/Adapters/Laravel/fixture/config/dark-sky-api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Secret Key
|--------------------------------------------------------------------------
|
| The secret key which grants you access to the Dark Sky API.
| The free account allows up to 1000 calls per day to API.
| Keep it secret, do not embed it to the response body.
|
| @link https://darksky.net/dev/register
|
*/

'key' => 'testing-secret-key',

/*
|--------------------------------------------------------------------------
| Language
|--------------------------------------------------------------------------
|
| Specify the language for the human-readable text summaries here.
| Check the documentation for the list of the supported values.
| Null means the usage of the default Dark Sky API settings.
|
| @see https://darksky.net/dev/docs#request-parameters
|
*/

'language' => 'en',

/*
|--------------------------------------------------------------------------
| Units
|--------------------------------------------------------------------------
|
| Here you may specify the unit system for the weather conditions.
| Check the documentation for the list of the supported values.
| Null means the usage of the default Dark Sky API settings.
|
| @see https://darksky.net/dev/docs#request-parameters
|
*/

'units' => 'si',

/*
|--------------------------------------------------------------------------
| Extend
|--------------------------------------------------------------------------
|
| Here specify the weather blocks, which should have the extended data.
| For now, it affects only the forecast requests, the hourly blocks.
| When present, the block extends from the 48 hours to 168 hours.
|
| @see https://darksky.net/dev/docs#request-parameters
|
*/

'extend' => null,

];
17 changes: 1 addition & 16 deletions tests/Adapters/Laravel/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
function config($key)
{
$config = require __DIR__.'/../../../src/Adapters/Laravel/config/dark-sky-api.php';
$config = require __DIR__.'/fixture/config/dark-sky-api.php';

return isset($config[$key]) ? $config[$key] : "config::{$key}";
}
Expand Down Expand Up @@ -49,18 +49,3 @@ function dd()
exit(1);
}
}

if (!function_exists('env')) {
/**
* Get the value of the environment variable.
*
* Defined here for the tests' backward compatibility with the Laravel "<5.4".
*
* @param string $key
* @return string
*/
function env($key)
{
return "env::{$key}";
}
}

0 comments on commit 5bacbb8

Please sign in to comment.