Passed
Push — master ( 6d705d...e99838 )
by Dmitry
01:37
created
src/Orders/Create/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      *      @param string $value
38 38
      *      @return string
39 39
      */
40
-    public function sessionId($value=null)
40
+    public function sessionId($value = null)
41 41
     {
42 42
         if ($value !== null)
43 43
         {
Please login to merge, or discard this patch.
src/Orders/Cancel/Request.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      *      @param string $value
43 43
      *      @return string
44 44
      */
45
-    public function sessionId($value=null)
45
+    public function sessionId($value = null)
46 46
     {
47 47
         if ($value !== null)
48 48
         {
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      *      @param string $value
59 59
      *      @return string
60 60
      */
61
-    public function id($value=null)
61
+    public function id($value = null)
62 62
     {
63 63
         if ($value !== null)
64 64
         {
Please login to merge, or discard this patch.
src/Orders/Show/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      *      @param string $value
38 38
      *      @return string
39 39
      */
40
-    public function id($value=null)
40
+    public function id($value = null)
41 41
     {
42 42
         if ($value !== null)
43 43
         {
Please login to merge, or discard this patch.
src/Exception/General.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
      *      @param string $message
12 12
      *      @param Throwable $previous
13 13
      */
14
-    public function __construct($message, \Exception $previous=null, $tracelog=false)
14
+    public function __construct($message, \Exception $previous = null, $tracelog = false)
15 15
     {
16
-        Log::instance()->error($message.(($tracelog)?PHP_EOL.$this->getTraceAsString():null));
16
+        Log::instance()->error($message.(($tracelog) ?PHP_EOL.$this->getTraceAsString() : null));
17 17
         $code = 0;
18 18
         parent::__construct($message, $code, $previous);
19 19
     }
Please login to merge, or discard this patch.
src/Sessions/Create/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
      *      @param string $value
43 43
      *      @return string
44 44
      */
45
-    public function clientId($value=null)
45
+    public function clientId($value = null)
46 46
     {
47 47
         if ($value !== null)
48 48
         {
Please login to merge, or discard this patch.
src/Reports/Client/Request.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
      *      @param string $value
38 38
      *      @return string
39 39
      */
40
-    public function sessionId($value=null)
40
+    public function sessionId($value = null)
41 41
     {
42 42
         if ($value !== null)
43 43
         {
Please login to merge, or discard this patch.
src/JWTOptions.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     /**
11 11
      *      @var array
12 12
      */
13
-    protected $jwt=array(
13
+    protected $jwt = array(
14 14
         'using'         => false,
15 15
         'UAPAY_pubkey'  => '',
16 16
         'our_privkey'   => '',
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
         if (isset($options['jwt']))
28 28
         {
29 29
             // using
30
-            if ( ! isset($options['jwt']['using']))
30
+            if (!isset($options['jwt']['using']))
31 31
             {
32 32
                 throw new Exception\Data('parameter jwt/using is not specified');
33 33
             }
34
-            if ( ! is_bool($options['jwt']['using']))
34
+            if (!is_bool($options['jwt']['using']))
35 35
             {
36 36
                 throw new Exception\Data('parameter jwt/using is incorrect');
37 37
             }
38 38
             // using
39
-            if ( ! isset($options['jwt']['UAPAY_pubkey']))
39
+            if (!isset($options['jwt']['UAPAY_pubkey']))
40 40
             {
41 41
                 throw new Exception\Data('parameter jwt/UAPAY_pubkey is not specified');
42 42
             }
43 43
             // using
44
-            if ( ! isset($options['jwt']['our_privkey']))
44
+            if (!isset($options['jwt']['our_privkey']))
45 45
             {
46 46
                 throw new Exception\Data('parameter jwt/our_privkey is not specified');
47 47
             }
Please login to merge, or discard this patch.
src/Callback.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
      *
38 38
      *      @param array $jwt_options array of options
39 39
      */
40
-    public function __construct($options=null)
40
+    public function __construct($options = null)
41 41
     {
42 42
         $jo = new JWTOptions($options);
43 43
         parent::__construct($this->get_http_raw_post_data(), $jo->get());
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
      */
59 59
     protected function get_http_raw_post_data()
60 60
     {
61
-        Log::instance()->add('callback request from ' . $_SERVER['REMOTE_ADDR']);
61
+        Log::instance()->add('callback request from '.$_SERVER['REMOTE_ADDR']);
62 62
 
63 63
         $raw_request = file_get_contents('php://input');
64 64
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 
84 84
         if ($this->jwt['using'] === true)
85 85
         {
86
-            if ( ! isset($this->json['token']))
86
+            if (!isset($this->json['token']))
87 87
             {
88 88
                 throw new Exception\JSON('json does not contain the token field!');
89 89
             }
Please login to merge, or discard this patch.
src/Response.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     /**
17 17
      *      @var array
18 18
      */
19
-    protected $jwt=array(
19
+    protected $jwt = array(
20 20
         'using'         => false,
21 21
         'UAPAY_pubkey'  => '',
22 22
         'our_privkey'   => '',
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
      *      @param string $json_string JSON string
34 34
      *      @param array $jwt_options array of options
35 35
      */
36
-    public function __construct($json_string, $jwt_options=null)
36
+    public function __construct($json_string, $jwt_options = null)
37 37
     {
38 38
         if (isset($jwt_options) && is_array($jwt_options))
39 39
         {
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         {
75 75
             throw new Exception\JSON('json response contain an error message!');
76 76
         }
77
-        if ( ! isset($this->json['status']))
77
+        if (!isset($this->json['status']))
78 78
         {
79 79
             throw new Exception\JSON('invalid json response!');
80 80
         }
@@ -84,14 +84,14 @@  discard block
 block discarded – undo
84 84
         }
85 85
         $this->status = $this->json['status'];
86 86
 
87
-        if ( ! isset($this->json['data']) || !is_array($this->json['data']))
87
+        if (!isset($this->json['data']) || !is_array($this->json['data']))
88 88
         {
89 89
             throw new Exception\JSON('json does not contain the data field!');
90 90
         }
91 91
 
92 92
         if ($this->jwt['using'] === true)
93 93
         {
94
-            if ( ! isset($this->json['data']['token']))
94
+            if (!isset($this->json['data']['token']))
95 95
             {
96 96
                 throw new Exception\JSON('data does not contain the token field!');
97 97
             }
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,8 +112,7 @@  discard block
 block discarded – undo
112 112
         {
113 113
             $key = new Key();
114 114
             $public_key = $key->get($this->jwt['UAPAY_pubkey']);
115
-        }
116
-        catch (\Exception $e)
115
+        } catch (\Exception $e)
117 116
         {
118 117
             throw new Exception\Runtime('The file with the public key was '.$e->getMessage().'!');
119 118
         }
@@ -133,8 +132,7 @@  discard block
 block discarded – undo
133 132
         try
134 133
         {
135 134
             $decoded = (array) JWT::decode($token, $this->uapay_public_key(), array('RS512'));
136
-        }
137
-        catch (\Exception $e)
135
+        } catch (\Exception $e)
138 136
         {
139 137
             Log::instance()->error($e->getMessage().PHP_EOL.$e->getTraceAsString());
140 138
             throw new Exception\JSON('unable to decode JWT token', $e);
Please login to merge, or discard this patch.