Completed
Push — master ( d77182...b3448d )
by Keal
02:40
created
src/lib/Rest.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,9 +62,9 @@
 block discarded – undo
62 62
      * @param string $url
63 63
      * @param mixed $data
64 64
      * @param mixed $header
65
-     * @param mixed $post
65
+     * @param integer $post
66 66
      *
67
-     * @return mixed
67
+     * @return string
68 68
      */
69 69
     public function curl_post($url, $data, $header, $post = 1)
70 70
     {
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     private $ServerIP;
21 21
     private $ServerPort;
22 22
     private $SoftVersion;
23
-    private $Batch;  //时间戳
23
+    private $Batch; //时间戳
24 24
     private $BodyType = 'json'; //包体格式,可填值:json 、xml
25 25
 
26 26
     public function __construct(array $config, $BodyType = 'json')
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
         $this->ServerIP = $config['serverIP'];
30 30
         $this->ServerPort = $config['serverPort'];
31 31
         $this->SoftVersion = $config['softVersion'];
32
-        $this->AppId=$config['appId'];
33
-        $this->AccountSid=$config['accountSid'];
34
-        $this->AccountToken=$config['accountToken'];
32
+        $this->AppId = $config['appId'];
33
+        $this->AccountSid = $config['accountSid'];
34
+        $this->AccountToken = $config['accountToken'];
35 35
         if (in_array($BodyType, ['xml', 'json'])) {
36 36
             $this->BodyType = $BodyType;
37 37
         }
Please login to merge, or discard this patch.
src/sms/Sms.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
         if($this->config=='YunTongXun'){
93 93
             $rest=new Rest(config('sms.agents.'.$this->config));
94 94
             return $rest->sendTemplateSMS($this->smsData['to'],$this->smsData['templateData'],$this->smsData['templates']['YunTongXun']);
95
-        }else{
95
+        } else{
96 96
             throw new \Exception('make sure you have choose a right agent');
97 97
         }
98 98
     }
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
      * @param null $tempId
73 73
      * @return $this
74 74
      */
75
-    public function template($agentName='SMS_AGENT', $tempId = null)
75
+    public function template($agentName = 'SMS_AGENT', $tempId = null)
76 76
     {
77
-        if ($agentName === 'SMS_AGENT'){
77
+        if ($agentName === 'SMS_AGENT') {
78 78
             $agentName = $this->config;
79 79
         }
80 80
         if (is_array($agentName)) {
@@ -107,10 +107,10 @@  discard block
 block discarded – undo
107 107
      */
108 108
     public function send()
109 109
     {
110
-        if($this->config=='YunTongXun'){
111
-            $rest=new Rest(config('sms.agents.'.$this->config));
112
-            return $rest->sendTemplateSMS($this->smsData['to'],$this->smsData['templateData'],$this->smsData['templates']['YunTongXun']);
113
-        }else{
110
+        if ($this->config == 'YunTongXun') {
111
+            $rest = new Rest(config('sms.agents.' . $this->config));
112
+            return $rest->sendTemplateSMS($this->smsData['to'], $this->smsData['templateData'], $this->smsData['templates']['YunTongXun']);
113
+        } else {
114 114
             throw new \Exception('make sure you have choose a right agent');
115 115
         }
116 116
     }
Please login to merge, or discard this patch.
src/sms/SmsServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     public function boot()
21 21
     {
22 22
         $this->publishes([
23
-            __DIR__.'/../config/sms.php' => config_path('sms.php'),
23
+            __DIR__ . '/../config/sms.php' => config_path('sms.php'),
24 24
         ]);
25 25
     }
26 26
 
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
     public function register()
33 33
     {
34 34
         $this->mergeConfigFrom(
35
-            __DIR__.'/../config/sms.php', 'sms'
35
+            __DIR__ . '/../config/sms.php', 'sms'
36 36
         );
37 37
 
38
-        $this->app->singleton('Sms',function($app){
39
-            $app=new Sms(config('sms.default'));
38
+        $this->app->singleton('Sms', function($app) {
39
+            $app = new Sms(config('sms.default'));
40 40
             return $app;
41 41
         });
42 42
     }
Please login to merge, or discard this patch.
src/lib/CurlTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
  */
16 16
 trait CurlTrait
17 17
 {
18
-    public $BodyType='json';
18
+    public $BodyType = 'json';
19 19
     /**
20 20
      * create url post
21 21
      * @param $url
Please login to merge, or discard this patch.
src/config/Sms.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
  * Time: 21:25
7 7
  */
8 8
 return [
9
-    'default' => env('SMS_AGENT','YunTongXun'),
9
+    'default' => env('SMS_AGENT', 'YunTongXun'),
10 10
 
11 11
     'agents' => [
12 12
         /*
Please login to merge, or discard this patch.
tests/SmsTest.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 
11 11
 use LaravelSms\sms\Sms;
12 12
 use PHPUnit_Framework_TestCase;
13
-use Mockery as m;
14 13
 
15 14
 class SmsTest extends PHPUnit_Framework_TestCase
16 15
 {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
     {
43 43
         $this->sms->to('123456...');
44 44
         $smsData = $this->smsData();
45
-        $this->assertEquals('123456...',$smsData['to']);
45
+        $this->assertEquals('123456...', $smsData['to']);
46 46
     }
47 47
 
48 48
     public function testSetContent()
Please login to merge, or discard this patch.