Completed
Pull Request — 1.11.x (#1599)
by José
28:19
created
plugin/buycourses/src/Requests/Proxy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,5 +31,5 @@
 block discarded – undo
31 31
 	 * @see Requests_Hooks::register
32 32
 	 * @param Requests_Hooks $hooks Hook system
33 33
 	 */
34
-	public function register(Requests_Hooks &$hooks);
34
+	public function register(Requests_Hooks & $hooks);
35 35
 }
36 36
\ No newline at end of file
Please login to merge, or discard this patch.
plugin/buycourses/src/Requests.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 		}
143 143
 
144 144
 		$file = str_replace('_', '/', $class);
145
-		if (file_exists(dirname(__FILE__) . '/' . $file . '.php')) {
146
-			require_once(dirname(__FILE__) . '/' . $file . '.php');
145
+		if (file_exists(dirname(__FILE__).'/'.$file.'.php')) {
146
+			require_once(dirname(__FILE__).'/'.$file.'.php');
147 147
 		}
148 148
 	}
149 149
 
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
 		$defaults = array(
504 504
 			'timeout' => 10,
505 505
 			'connect_timeout' => 10,
506
-			'useragent' => 'php-requests/' . self::VERSION,
506
+			'useragent' => 'php-requests/'.self::VERSION,
507 507
 			'protocol_version' => 1.1,
508 508
 			'redirected' => 0,
509 509
 			'redirects' => 10,
@@ -533,11 +533,11 @@  discard block
 block discarded – undo
533 533
 	 * @return string Default certificate path.
534 534
 	 */
535 535
 	public static function get_certificate_path() {
536
-		if ( ! empty( Requests::$certificate_path ) ) {
536
+		if (!empty(Requests::$certificate_path)) {
537 537
 			return Requests::$certificate_path;
538 538
 		}
539 539
 
540
-		return dirname(__FILE__) . '/Requests/Transport/cacert.pem';
540
+		return dirname(__FILE__).'/Requests/Transport/cacert.pem';
541 541
 	}
542 542
 
543 543
 	/**
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
 	 *
546 546
 	 * @param string $path Certificate path, pointing to a PEM file.
547 547
 	 */
548
-	public static function set_certificate_path( $path ) {
548
+	public static function set_certificate_path($path) {
549 549
 		Requests::$certificate_path = $path;
550 550
 	}
551 551
 
Please login to merge, or discard this patch.
plugin/buycourses/src/culqi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@
 block discarded – undo
14 14
  */
15 15
 
16 16
 // Errors
17
-include_once(dirname(__FILE__). '/Culqi/Error/Errors.php');
18
-include_once(dirname(__FILE__). '/Culqi/AuthBearer.php');
17
+include_once(dirname(__FILE__).'/Culqi/Error/Errors.php');
18
+include_once(dirname(__FILE__).'/Culqi/AuthBearer.php');
19 19
 include_once dirname(__FILE__).'/Culqi/Client.php';
20 20
 include_once dirname(__FILE__).'/Culqi/Resource.php';
21 21
 
Please login to merge, or discard this patch.
plugin/buycourses/src/Culqi/Planes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,13 +21,13 @@
 block discarded – undo
21 21
     public function get($id)
22 22
     {
23 23
 
24
-        return $this->request("GET", Planes::URL_PLANES . $id . "/", $api_key = $this->culqi->api_key);
24
+        return $this->request("GET", Planes::URL_PLANES.$id."/", $api_key = $this->culqi->api_key);
25 25
     }
26 26
 
27 27
     public function delete($id)
28 28
     {
29 29
 
30
-       return $this->request("DELETE", Planes::URL_PLANES . $id . "/", $api_key = $this->culqi->api_key);
30
+       return $this->request("DELETE", Planes::URL_PLANES.$id."/", $api_key = $this->culqi->api_key);
31 31
 
32 32
    }
33 33
 
Please login to merge, or discard this patch.
plugin/buycourses/src/Culqi/AuthBearer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 		$this->password = $password;
11 11
 	}
12 12
 
13
-	public function register(\Requests_Hooks &$hooks) {
13
+	public function register(\Requests_Hooks & $hooks) {
14 14
 		$hooks->register('requests.before_request', array(&$this, 'before_request'));
15 15
 	}
16 16
 
Please login to merge, or discard this patch.
plugin/buycourses/src/Culqi/Devoluciones.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
     public function get($id)
19 19
     {
20
-        return $this->request("GET", Devoluciones::URL_REFUND . $id . "/", $api_key = $this->culqi->api_key);
20
+        return $this->request("GET", Devoluciones::URL_REFUND.$id."/", $api_key = $this->culqi->api_key);
21 21
     }
22 22
 
23 23
 
Please login to merge, or discard this patch.
plugin/buycourses/src/Culqi/Client.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,22 +17,22 @@
 block discarded – undo
17 17
     const BASE_URL = "https://integ-pago.culqi.com/api/v1";
18 18
 
19 19
 
20
-    public function request($method, $url, $api_key, $data = NULL, $headers= array("Content-Type" => "application/json", "Accept" => "application/json") ) {
20
+    public function request($method, $url, $api_key, $data = NULL, $headers = array("Content-Type" => "application/json", "Accept" => "application/json")) {
21 21
         try {
22 22
             $options = array(
23 23
                 'auth' => new AuthBearer($api_key),
24 24
                 'timeout' => 120
25 25
             );
26
-            if($method == "GET") {
27
-                $url_params = is_array($data) ? '?' . http_build_query($data) : '';
28
-                $response = \Requests::get(Culqi::$api_base . $url . $url_params, $headers, $options);
29
-            } else if($method == "POST") {
30
-                $response = \Requests::post(Culqi::$api_base . $url, $headers, json_encode($data), $options);
26
+            if ($method == "GET") {
27
+                $url_params = is_array($data) ? '?'.http_build_query($data) : '';
28
+                $response = \Requests::get(Culqi::$api_base.$url.$url_params, $headers, $options);
29
+            } else if ($method == "POST") {
30
+                $response = \Requests::post(Culqi::$api_base.$url, $headers, json_encode($data), $options);
31 31
 
32 32
 
33
-            } else if($method == "PATCH") {
34
-                $response = \Requests::patch(Culqi::$api_base . $url, $headers, json_encode($data), $options);
35
-            } else if($method == "DELETE") {
33
+            } else if ($method == "PATCH") {
34
+                $response = \Requests::patch(Culqi::$api_base.$url, $headers, json_encode($data), $options);
35
+            } else if ($method == "DELETE") {
36 36
                 $response = \Requests::delete(Culqi::$api_base, $options);
37 37
             }
38 38
         } catch (\Exception $e) {
Please login to merge, or discard this patch.
plugin/buycourses/src/Culqi/Cargos.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 
18 18
     public function get($id)
19 19
     {
20
-        return $this->request("GET", Cargos::URL_CARGOS . $id . "/", $api_key = $this->culqi->api_key);
20
+        return $this->request("GET", Cargos::URL_CARGOS.$id."/", $api_key = $this->culqi->api_key);
21 21
     }
22 22
 
23 23
 
Please login to merge, or discard this patch.
plugin/buycourses/src/paymentsetup.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             Display::return_message(get_lang('ItemRemoved'), 'success')
29 29
         );
30 30
 
31
-        header('Location: ' . api_get_self());
31
+        header('Location: '.api_get_self());
32 32
         exit;
33 33
     }
34 34
 }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         Display::return_message(get_lang('Saved'), 'success')
47 47
     );
48 48
 
49
-    header('Location:' . api_get_self());
49
+    header('Location:'.api_get_self());
50 50
     exit;
51 51
 }
52 52
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
     }
79 79
 }
80 80
 
81
-$currencyForm->addTextarea('terms_and_conditions', [ get_lang('TermsAndConditions'), $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce') ], '');
81
+$currencyForm->addTextarea('terms_and_conditions', [get_lang('TermsAndConditions'), $plugin->get_lang('WriteHereTheTermsAndConditionsOfYourECommerce')], '');
82 82
 $currencyForm->addButtonSave(get_lang('Save'));
83 83
 $currencyForm->setDefaults($plugin->getGlobalParameters());
84 84
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         Display::return_message(get_lang('Saved'), 'success')
96 96
     );
97 97
 
98
-    header('Location:' . api_get_self());
98
+    header('Location:'.api_get_self());
99 99
     exit;
100 100
 }
101 101
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         Display::return_message(get_lang('Saved'), 'success')
135 135
     );
136 136
 
137
-    header('Location:' . api_get_self());
137
+    header('Location:'.api_get_self());
138 138
     exit;
139 139
 }
140 140
 
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         Display::return_message(get_lang('Saved'), 'success')
161 161
     );
162 162
 
163
-    header('Location:' . api_get_self());
163
+    header('Location:'.api_get_self());
164 164
     exit;
165 165
 }
166 166
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         Display::return_message(get_lang('Saved'), 'success')
200 200
     );
201 201
 
202
-    header('Location:' . api_get_self());
202
+    header('Location:'.api_get_self());
203 203
     exit;
204 204
 }
205 205
 
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
 // breadcrumbs
223 223
 $interbreadcrumb[] = [
224
-    'url' => api_get_path(WEB_PLUGIN_PATH) . 'buycourses/index.php',
224
+    'url' => api_get_path(WEB_PLUGIN_PATH).'buycourses/index.php',
225 225
     'name' => $plugin->get_lang('plugin_title')
226 226
 ];
227 227
 
Please login to merge, or discard this patch.