Passed
Branch master (b39b64)
by ma
02:02
created
Category
src/Weather.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     protected $key; // APIkey
12 12
 
13
-    protected $guzzleOptions = []; // guzzle的配置
13
+    protected $guzzleOptions = [ ]; // guzzle的配置
14 14
 
15 15
     public function __construct($key)
16 16
     {
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         $url = 'https://restapi.amap.com/v3/weather/weatherInfo'; // 接口url地址
33 33
 
34 34
         // 1.对 `$format` 和 `$type` 参数进行检查,不在范围内的抛出异常
35
-        if (!in_array(strtolower($format), ['xml', 'json'])) {
35
+        if (!in_array(strtolower($format), [ 'xml', 'json' ])) {
36 36
             throw new InvalidArgumentException('Invalid response format: '.$format);
37 37
         }
38 38
 
39
-        if (!in_array(strtolower($type), ['base', 'all'])) {
39
+        if (!in_array(strtolower($type), [ 'base', 'all' ])) {
40 40
             throw new InvalidArgumentException('Invalid type value(base/all): '.$type);
41 41
         }
42 42
 
Please login to merge, or discard this patch.
src/ServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 
9 9
     public function register()
10 10
     {
11
-        $this->app->singleton(Weather::class, function () {
11
+        $this->app->singleton(Weather::class, function() {
12 12
             return new Weather(config('services.weather.key'));
13 13
         });
14 14
 
@@ -17,6 +17,6 @@  discard block
 block discarded – undo
17 17
 
18 18
     public function provides()
19 19
     {
20
-        return [Weather::class, 'weather'];
20
+        return [ Weather::class, 'weather' ];
21 21
     }
22 22
 }
Please login to merge, or discard this patch.