@@ -42,7 +42,7 @@ |
||
42 | 42 | { |
43 | 43 | throw new FormatException('invalid json response!'); |
44 | 44 | } |
45 | - $this->error_code = (isset($this->json['error']['code']))?$this->json['error']['code']:'undefined'; |
|
45 | + $this->error_code = (isset($this->json['error']['code'])) ? $this->json['error']['code'] : 'undefined'; |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -37,7 +37,7 @@ |
||
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 | { |
@@ -42,7 +42,7 @@ discard block |
||
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 |
||
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 | { |
@@ -37,7 +37,7 @@ |
||
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 | { |
@@ -11,9 +11,9 @@ |
||
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 | } |
@@ -42,7 +42,7 @@ |
||
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 | { |
@@ -80,7 +80,7 @@ |
||
80 | 80 | */ |
81 | 81 | protected function get_http_raw_post_data() |
82 | 82 | { |
83 | - Log::instance()->add('callback request from ' . $_SERVER['REMOTE_ADDR']); |
|
83 | + Log::instance()->add('callback request from '.$_SERVER['REMOTE_ADDR']); |
|
84 | 84 | |
85 | 85 | $raw_request = file_get_contents('php://input'); |
86 | 86 |
@@ -37,7 +37,7 @@ |
||
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 | { |
@@ -16,7 +16,7 @@ discard block |
||
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' => '', |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public function __construct($options) |
37 | 37 | { |
38 | 38 | // api_url |
39 | - if ( ! isset($options['api_uri'])) |
|
39 | + if (!isset($options['api_uri'])) |
|
40 | 40 | { |
41 | 41 | throw new Exception\Data('parameter api_uri is not specified'); |
42 | 42 | } |
@@ -44,21 +44,21 @@ discard block |
||
44 | 44 | if (isset($options['jwt'])) |
45 | 45 | { |
46 | 46 | // using |
47 | - if ( ! isset($options['jwt']['using'])) |
|
47 | + if (!isset($options['jwt']['using'])) |
|
48 | 48 | { |
49 | 49 | throw new Exception\Data('parameter jwt/using is not specified'); |
50 | 50 | } |
51 | - if ( ! is_bool($options['jwt']['using'])) |
|
51 | + if (!is_bool($options['jwt']['using'])) |
|
52 | 52 | { |
53 | 53 | throw new Exception\Data('parameter jwt/using is incorrect'); |
54 | 54 | } |
55 | 55 | // using |
56 | - if ( ! isset($options['jwt']['UAPAY_pubkey'])) |
|
56 | + if (!isset($options['jwt']['UAPAY_pubkey'])) |
|
57 | 57 | { |
58 | 58 | throw new Exception\Data('parameter jwt/UAPAY_pubkey is not specified'); |
59 | 59 | } |
60 | 60 | // using |
61 | - if ( ! isset($options['jwt']['our_privkey'])) |
|
61 | + if (!isset($options['jwt']['our_privkey'])) |
|
62 | 62 | { |
63 | 63 | throw new Exception\Data('parameter jwt/our_privkey is not specified'); |
64 | 64 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | * @param array $value |
80 | 80 | * @return array |
81 | 81 | */ |
82 | - public function data($value=null) |
|
82 | + public function data($value = null) |
|
83 | 83 | { |
84 | 84 | if ($value !== null) |
85 | 85 | { |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | * @param mixed $value |
96 | 96 | * @return string |
97 | 97 | */ |
98 | - protected function as_string($value=null) |
|
98 | + protected function as_string($value = null) |
|
99 | 99 | { |
100 | - return (is_scalar($value))?((is_bool($value))?(($value)?'true':'false'):"$value"):null; |
|
100 | + return (is_scalar($value)) ? ((is_bool($value)) ? (($value) ? 'true' : 'false') : "$value") : null; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | * @param mixed $value |
107 | 107 | * @return integer |
108 | 108 | */ |
109 | - protected function as_int($value=null) |
|
109 | + protected function as_int($value = null) |
|
110 | 110 | { |
111 | - return (is_int($value))?$value:null; |
|
111 | + return (is_int($value)) ? $value : null; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | * @param mixed $value |
118 | 118 | * @return array |
119 | 119 | */ |
120 | - protected function as_array($value=null) |
|
120 | + protected function as_array($value = null) |
|
121 | 121 | { |
122 | - return (is_array($value))?$value:null; |
|
122 | + return (is_array($value)) ? $value : null; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | protected function own_private_key() |
182 | 182 | { |
183 | 183 | // check private key file |
184 | - if ( ! file_exists($this->jwt['our_privkey'])) |
|
184 | + if (!file_exists($this->jwt['our_privkey'])) |
|
185 | 185 | { |
186 | 186 | throw new Exception\Runtime('The file with the private key was not find!'); |
187 | 187 | } |