Passed
Pull Request — master (#68)
by yi
01:33
created
src/Robot.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      * @param string $accessToken
34 34
      * @param string $secret
35 35
      */
36
-    public function __construct($accessToken,$secret='')
36
+    public function __construct($accessToken, $secret = '')
37 37
     {
38 38
         $this->accessToken = $accessToken;
39 39
         $this->secret = $secret;
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
      * @param string $secret
45 45
      * @return self
46 46
      */
47
-    public static function create($accessToken,$secret='')
47
+    public static function create($accessToken, $secret = '')
48 48
     {
49
-        return new static($accessToken,$secret);
49
+        return new static($accessToken, $secret);
50 50
     }
51 51
 
52 52
     /**
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function send($message)
62 62
     {
63
-        $url='https://oapi.dingtalk.com/robot/send?access_token='.$this->accessToken;
63
+        $url = 'https://oapi.dingtalk.com/robot/send?access_token='.$this->accessToken;
64 64
         if (!empty($this->secret)) {
65
-            $timestamp = time() . '000';
66
-            $signature = base64_encode(hash_hmac('sha256', $timestamp . "\n" . $this->secret, $this->secret, true));
65
+            $timestamp = time().'000';
66
+            $signature = base64_encode(hash_hmac('sha256', $timestamp."\n".$this->secret, $this->secret, true));
67 67
             $sign      = urlencode($signature);
68
-            $url       .= sprintf('&sign=%s&timestamp=%s',$sign, $timestamp);
68
+            $url .= sprintf('&sign=%s&timestamp=%s', $sign, $timestamp);
69 69
         }
70 70
         $response = $this->getHttpClient()->request(
71 71
             'POST', $url, ['json' => $message]
Please login to merge, or discard this patch.