Passed
Pull Request — master (#132)
by
unknown
02:43
created
src/Drivers/Paypal/Paypal.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,7 @@
 block discarded – undo
126 126
 
127 127
         if ($result->Status != 100) {
128 128
             $message = $this->translateStatus($result->Status);
129
-            throw new InvalidPaymentException($message, is_numeric($result->Status)?$result->Status:0);
129
+            throw new InvalidPaymentException($message, is_numeric($result->Status) ? $result->Status : 0);
130 130
         }
131 131
 
132 132
         return $this->createReceipt($result->RefID);
Please login to merge, or discard this patch.
src/Drivers/Poolam/Poolam.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
         if (empty($body['status']) || $body['status'] != 1) {
81 81
             // some error has happened
82
-            throw new PurchaseFailedException($body['status'], is_numeric($body['status']??0)?($body['status']??0):0);
82
+            throw new PurchaseFailedException($body['status'], is_numeric($body['status'] ?? 0) ? ($body['status'] ?? 0) : 0);
83 83
         }
84 84
 
85 85
         $this->invoice->transactionId($body['invoice_key']);
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
     private function notVerified($message, $status = 0)
157 157
     {
158 158
         if (empty($message)) {
159
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status)?$status:0);
159
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status) ? $status : 0);
160 160
         } else {
161
-            throw new InvalidPaymentException($message, is_numeric($status)?$status:0);
161
+            throw new InvalidPaymentException($message, is_numeric($status) ? $status : 0);
162 162
         }
163 163
     }
164 164
 }
Please login to merge, or discard this patch.
src/Drivers/Idpay/Idpay.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -233,9 +233,9 @@
 block discarded – undo
233 233
             "54" => "مدت زمان تایید پرداخت سپری شده است.",
234 234
         );
235 235
         if (array_key_exists($status, $translations)) {
236
-            throw new InvalidPaymentException($translations[$status], is_numeric($status)?$status:0);
236
+            throw new InvalidPaymentException($translations[$status], is_numeric($status) ? $status : 0);
237 237
         } else {
238
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status)?$status:0);
238
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status) ? $status : 0);
239 239
         }
240 240
     }
241 241
 }
Please login to merge, or discard this patch.
src/Drivers/Payping/Payping.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             // some error has happened
107 107
             $message = is_array($body) ? array_pop($body) : $this->convertStatusCodeToMessage($statusCode);
108 108
 
109
-            throw new PurchaseFailedException($message, is_numeric($statusCode)?$statusCode:0);
109
+            throw new PurchaseFailedException($message, is_numeric($statusCode) ? $statusCode : 0);
110 110
         }
111 111
 
112 112
         $this->invoice->transactionId($body['code']);
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         if ($statusCode !== 200) {
165 165
             $message = is_array($body) ? array_pop($body) : $this->convertStatusCodeToMessage($statusCode);
166 166
 
167
-            $this->notVerified($message, is_numeric($statusCode)?$statusCode:0);
167
+            $this->notVerified($message, is_numeric($statusCode) ? $statusCode : 0);
168 168
         }
169 169
 
170 170
         return $this->createReceipt($refId);
Please login to merge, or discard this patch.
src/Drivers/Yekpay/Yekpay.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         if ($response->Code != 100) {
96 96
             //"Request failed with Error code: $response->Code and Error message: $response->Description";
97
-            throw new PurchaseFailedException($response->Description, is_numeric($response->Code)?$response->Code:0);
97
+            throw new PurchaseFailedException($response->Description, is_numeric($response->Code) ? $response->Code : 0);
98 98
         }
99 99
 
100 100
         $this->invoice->transactionId($response->Authority);
@@ -163,12 +163,12 @@  discard block
 block discarded – undo
163 163
      * @param $message
164 164
      * @throws InvalidPaymentException
165 165
      */
166
-    private function notVerified($message, $status=0)
166
+    private function notVerified($message, $status = 0)
167 167
     {
168 168
         if ($message) {
169
-            throw new InvalidPaymentException($message, is_numeric($status)?$status:0);
169
+            throw new InvalidPaymentException($message, is_numeric($status) ? $status : 0);
170 170
         } else {
171
-            throw new InvalidPaymentException('payment failed', is_numeric($status)?$status:0);
171
+            throw new InvalidPaymentException('payment failed', is_numeric($status) ? $status : 0);
172 172
         }
173 173
     }
174 174
 }
Please login to merge, or discard this patch.
src/Drivers/Parsian/Parsian.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
             $this->invoice->transactionId($result->Token);
67 67
         } else {
68 68
             // an error has happened
69
-            throw new PurchaseFailedException($result->Message, $result->Status??0);
69
+            throw new PurchaseFailedException($result->Message, $result->Status ?? 0);
70 70
         }
71 71
 
72 72
         // return the transaction's id
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function pay() : RedirectionForm
82 82
     {
83
-        $payUrl = $this->settings->apiPaymentUrl . '?Token=' . $this->invoice->getTransactionId() ;
83
+        $payUrl = $this->settings->apiPaymentUrl.'?Token='.$this->invoice->getTransactionId();
84 84
 
85 85
         return $this->redirectWithForm(
86 86
             $payUrl,
Please login to merge, or discard this patch.
src/Drivers/Irankish/Irankish.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -195,9 +195,9 @@
 block discarded – undo
195 195
             -90 => 'تراکنش قبلا تایید شده است'
196 196
         );
197 197
         if (array_key_exists($status, $translations)) {
198
-            throw new InvalidPaymentException($translations[$status], is_numeric($status)?$status:0);
198
+            throw new InvalidPaymentException($translations[$status], is_numeric($status) ? $status : 0);
199 199
         } else {
200
-            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status)?$status:0);
200
+            throw new InvalidPaymentException('خطای ناشناخته ای رخ داده است.', is_numeric($status) ? $status : 0);
201 201
         }
202 202
     }
203 203
 }
Please login to merge, or discard this patch.
src/Drivers/Payir/Payir.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public function pay(): RedirectionForm
113 113
     {
114
-        $payUrl = $this->settings->apiPaymentUrl . $this->invoice->getTransactionId();
114
+        $payUrl = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId();
115 115
 
116 116
         return $this->redirectWithForm($payUrl, [], 'GET');
117 117
     }
@@ -206,9 +206,9 @@  discard block
 block discarded – undo
206 206
         );
207 207
 
208 208
         if (array_key_exists($status, $translations)) {
209
-            throw new InvalidPaymentException($translations[$status], is_numeric($status)?$status:0);
209
+            throw new InvalidPaymentException($translations[$status], is_numeric($status) ? $status : 0);
210 210
         } else {
211
-            throw new InvalidPaymentException('تراکنش با خطا مواجه شد.', is_numeric($status)?$status:0);
211
+            throw new InvalidPaymentException('تراکنش با خطا مواجه شد.', is_numeric($status) ? $status : 0);
212 212
         }
213 213
     }
214 214
 }
Please login to merge, or discard this patch.
src/Drivers/Local/Local.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
     {
157 157
         $urlWithQuery = $url;
158 158
         foreach ($params as $key => $value) {
159
-            $urlWithQuery .= (parse_url($urlWithQuery, PHP_URL_QUERY) ? '&' : '?') . "{$key}={$value}";
159
+            $urlWithQuery .= (parse_url($urlWithQuery, PHP_URL_QUERY) ? '&' : '?')."{$key}={$value}";
160 160
         }
161 161
         return $urlWithQuery;
162 162
     }
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
         );
177 177
 
178 178
         if (array_key_exists($status, $translations)) {
179
-            throw new InvalidPaymentException($translations[$status], is_numeric($status)?$status:0);
179
+            throw new InvalidPaymentException($translations[$status], is_numeric($status) ? $status : 0);
180 180
         } else {
181
-            throw new InvalidPaymentException('تراکنش با خطا مواجه شد.', is_numeric($status)?$status:0);
181
+            throw new InvalidPaymentException('تراکنش با خطا مواجه شد.', is_numeric($status) ? $status : 0);
182 182
         }
183 183
     }
184 184
 }
Please login to merge, or discard this patch.