Skip to content

Commit 72c95a1

Browse files
authored
Merge pull request #4 from rakibdevs/dev
Update OpenWeather
2 parents dbd5043 + 553da2f commit 72c95a1

12 files changed

+317
-230
lines changed

.php-cs-fixer.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"php":"8.0.5","version":"3.0.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"single_trait_insert_per_statement":true},"hashes":{"src\/config\/openweather.php":4030960505,"src\/WeatherServiceProvider.php":2191476785,"src\/Weather.php":2611710060,"src\/Exceptions\/WeatherException.php":3354548136}}
1+
{"php":"8.0.5","version":"3.0.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"single_trait_insert_per_statement":true},"hashes":{"src\/config\/openweather.php":4030960505,"src\/WeatherServiceProvider.php":1976251433,"src\/Weather.php":3101166183,"src\/Exceptions\/WeatherException.php":1149541561,"src\/WeatherFormat.php":2320223748,"src\/Exceptions\/InvalidConfiguration.php":2682133250,"src\/WeatherClient.php":330072577}}

composer.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rakibdevs/openweather-laravel-api",
3-
"description": "Laravel package to connect https://openweathermap.org/ to get weather data for any location on the globe immediately",
3+
"description": "Laravel package to connect https://openweathermap.org/ to get customized weather data for any location on the globe immediately",
44
"keywords": ["laravel","weather","open-weather","api"],
55
"license": "MIT",
66
"authors": [
@@ -11,13 +11,22 @@
1111
}
1212
],
1313
"require": {
14-
"php": "^7.0|^8.0",
15-
"guzzlehttp/guzzle": "^6.3.1|^7.0.1"
14+
"php": "^7.2|^7.3|^7.4|^8.0",
15+
"guzzlehttp/guzzle": "^6.3|^7.0"
16+
},
17+
"require-dev": {
18+
"laravel/framework": "^6.0|^7.0|^8.0",
19+
"phpunit/phpunit": "^8.0|^9.0"
1620
},
1721
"autoload": {
1822
"psr-4": {
1923
"RakibDevs\\Weather\\": "src"
2024
}
25+
},
26+
"autoload-dev": {
27+
"psr-4": {
28+
"RakibDevs\\Weather\\Tests\\": "tests"
29+
}
2130
},
2231
"extra": {
2332
"laravel": {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
namespace RakibDevs\Weather\Exceptions;
3+
4+
use Exception;
5+
6+
class InvalidConfiguration extends Exception
7+
{
8+
public static function apiKeyNotSpecified()
9+
{
10+
return new static('There was no `api_key` specified. You must provide a valid API KEY to get weather data from Open Weather.');
11+
}
12+
}

src/Exceptions/WeatherException.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,4 @@
55

66
class WeatherException extends Exception
77
{
8-
private $e;
9-
10-
public function __construct($e)
11-
{
12-
$this->e = $e;
13-
}
14-
15-
public function render()
16-
{
17-
return $this->e->getResponse() == null?'Nothing found':$this->e->getResponse()->getBody(true);
18-
}
198
}

0 commit comments

Comments
 (0)