@@ -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' => '', |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function __construct($options) |
36 | 36 | { |
37 | 37 | // api_url |
38 | - if ( ! isset($options['api_uri'])) |
|
38 | + if (!isset($options['api_uri'])) |
|
39 | 39 | { |
40 | 40 | throw new Exception\Data('parameter api_uri is not specified'); |
41 | 41 | } |
@@ -43,21 +43,21 @@ discard block |
||
43 | 43 | if (isset($options['jwt'])) |
44 | 44 | { |
45 | 45 | // using |
46 | - if ( ! isset($options['jwt']['using'])) |
|
46 | + if (!isset($options['jwt']['using'])) |
|
47 | 47 | { |
48 | 48 | throw new Exception\Data('parameter jwt/using is not specified'); |
49 | 49 | } |
50 | - if ( ! is_bool($options['jwt']['using'])) |
|
50 | + if (!is_bool($options['jwt']['using'])) |
|
51 | 51 | { |
52 | 52 | throw new Exception\Data('parameter jwt/using is incorrect'); |
53 | 53 | } |
54 | 54 | // using |
55 | - if ( ! isset($options['jwt']['UAPAY_pubkey'])) |
|
55 | + if (!isset($options['jwt']['UAPAY_pubkey'])) |
|
56 | 56 | { |
57 | 57 | throw new Exception\Data('parameter jwt/UAPAY_pubkey is not specified'); |
58 | 58 | } |
59 | 59 | // using |
60 | - if ( ! isset($options['jwt']['our_privkey'])) |
|
60 | + if (!isset($options['jwt']['our_privkey'])) |
|
61 | 61 | { |
62 | 62 | throw new Exception\Data('parameter jwt/our_privkey is not specified'); |
63 | 63 | } |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param array $value |
79 | 79 | * @return array |
80 | 80 | */ |
81 | - public function data($value=null) |
|
81 | + public function data($value = null) |
|
82 | 82 | { |
83 | 83 | if ($value !== null) |
84 | 84 | { |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | * @param mixed $value |
95 | 95 | * @return string |
96 | 96 | */ |
97 | - protected function as_string($value=null) |
|
97 | + protected function as_string($value = null) |
|
98 | 98 | { |
99 | - return (is_scalar($value))?((is_bool($value))?(($value)?'true':'false'):"$value"):null; |
|
99 | + return (is_scalar($value)) ? ((is_bool($value)) ? (($value) ? 'true' : 'false') : "$value") : null; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -105,9 +105,9 @@ discard block |
||
105 | 105 | * @param mixed $value |
106 | 106 | * @return integer |
107 | 107 | */ |
108 | - protected function as_int($value=null) |
|
108 | + protected function as_int($value = null) |
|
109 | 109 | { |
110 | - return (is_int($value))?$value:null; |
|
110 | + return (is_int($value)) ? $value : null; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | * @param mixed $value |
117 | 117 | * @return array |
118 | 118 | */ |
119 | - protected function as_array($value=null) |
|
119 | + protected function as_array($value = null) |
|
120 | 120 | { |
121 | - return (is_array($value))?$value:null; |
|
121 | + return (is_array($value)) ? $value : null; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $payload['iat'] = $this->get_param_iat(); |
162 | 162 | |
163 | 163 | // check private key file |
164 | - if ( ! file_exists($this->jwt['our_privkey'])) |
|
164 | + if (!file_exists($this->jwt['our_privkey'])) |
|
165 | 165 | { |
166 | 166 | throw new Exception\Runtime('The file with the private key was not find!'); |
167 | 167 | } |