Test Failed
Push — master ( 94e0e2...54608a )
by Joe
02:18
created
src/LiteSpeed.php 3 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,8 +25,8 @@  discard block
 block discarded – undo
25 25
 	public $params = [];
26 26
 	public $response = [];
27 27
 	public $valid_products = ['LSWS', 'LSLB'];
28
-	public $valid_cpu = ['1','2','4','8','V','U'];
29
-	public $valid_period = ['monthly','yearly','owned'];
28
+	public $valid_cpu = ['1', '2', '4', '8', 'V', 'U'];
29
+	public $valid_period = ['monthly', 'yearly', 'owned'];
30 30
 	public $valid_payment = ['credit', 'creditcard'];
31 31
 	public $raw_response;
32 32
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 			curl_setopt($ch, CURLOPT_POST, true);
306 306
 			$pstring = '';
307 307
 			foreach ($this->params as $param => $value) {
308
-				$pstring .= '&' . $param . '=' . $value . '';
308
+				$pstring .= '&'.$param.'='.$value.'';
309 309
 			}
310 310
 			$pstring = mb_substr($pstring, 1);
311 311
 			curl_setopt($ch, CURLOPT_POSTFIELDS, $pstring);
@@ -313,10 +313,10 @@  discard block
 block discarded – undo
313 313
 			curl_setopt($ch, CURLOPT_POST, false);
314 314
 			$pstring = '';
315 315
 			foreach ($this->params as $param => $value) {
316
-				$pstring .= '&' . $param . '=' . $value . '';
316
+				$pstring .= '&'.$param.'='.$value.'';
317 317
 			}
318 318
 			$pstring = mb_substr($pstring, 1);
319
-			$url .= '?' . $pstring;
319
+			$url .= '?'.$pstring;
320 320
 		}
321 321
 		myadmin_log('licenses', 'info', "LiteSpeed URL: $url\npstring: $pstring\n", __LINE__, __FILE__);
322 322
 		curl_setopt($ch, CURLOPT_URL, $url);
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 
338 338
 		// Extract the response details.
339 339
 		$this->response = xml2array($this->raw_response);
340
-		myadmin_log('licenses', 'info', 'LiteSpeed Response ' . var_export($this->response, true), __LINE__, __FILE__);
340
+		myadmin_log('licenses', 'info', 'LiteSpeed Response '.var_export($this->response, true), __LINE__, __FILE__);
341 341
 		if (empty($this->response['error'])) {
342 342
 			unset($this->response['error']);
343 343
 			return $this->response;
Please login to merge, or discard this patch.
Indentation   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -56,74 +56,74 @@
 block discarded – undo
56 56
 	}
57 57
 
58 58
 	/**
59
-	* LiteSpeed Order License Return
60
-	* 		* 	If any errors occur during this process, <result> will contain “error” and <message>
61
-	* 	will contain a detailed description:
62
-	* 		<LiteSpeed_eService>
63
-	* 			<action>Order</action>
64
-	* 			<result>error</result>
65
-	* 			<message>Invalid cpu!</message>
66
-	* 		</LiteSpeed_eService>
67
-	* 	If the transaction cannot be completed, <result> will be “incomplete”. For example, if
68
-	* 	payment method is “credit”, but there is not enough credit in your account, or if payment method
69
-	* 	is “creditcard”, but the charge cannot go through, then the transaction will not be completed
70
-	* 	and <result> will display “incomplete”. <license_id> and <invoice> will be provided. You will
71
-	* 	need to login to LiteSpeed’s online store and pay the invoice to finish the order.
72
-	* 		If payment method is “credit”, but not enough credit is available to your account:
73
-	* 			<LiteSpeed_eService>
74
-	* 				<action>Order</action>
75
-	* 					<license_id>6066</license_id>
76
-	* 				<license_type>WS_L_V</license_type>
77
-	* 				<invoice_id>12466</invoice_id>
78
-	* 				<result>incomplete</result>
79
-	* 				<message>need to pay invoice first</message>
80
-	* 			</LiteSpeed_eService>
81
-	* 		If payment method is “creditcard”, but the attempted credit card payment failed:
82
-	* 			<LiteSpeed_eService>
83
-	* 				<action>Order</action>
84
-	* 				<license_id>9329</license_id>
85
-	* 				<license_type>WS_L_V</license_type>
86
-	* 				<invoice_id>20568</invoice_id>
87
-	* 				<result>incomplete</result>
88
-	* 				<message>need to pay invoice first, credit card payment failed</message>
89
-	* 			</LiteSpeed_eService>
90
-	* 	If the transaction is successful, which should happen for the majority of cases, you will get a
91
-	* 	serial number back. You can parse the message to get the serial number and create your own script
92
-	* 	for installation. You will still receive the same confirmation email and serial number emails as
93
-	* 	if you ordered online. There will be no <invoice_id> if the charge was paid with credit.
94
-	* 		<LiteSpeed_eService>
95
-	* 			<action>Order</action>
96
-	* 			< license_id>6067</ license_id>
97
-	* 			<license_type>WS_L_V</license_type>
98
-	* 			<invoice_id>12466</invoice_id>
99
-	* 			< license_serial>gv06-kXsU-SHBr-pL4N</license_serial>
100
-	* 			<result>success</result>
101
-	* 			<message>new order automatically accepted</message>
102
-	* 		</LiteSpeed_eService>
103
-	*
104
-	*/
59
+	 * LiteSpeed Order License Return
60
+	 * 		* 	If any errors occur during this process, <result> will contain “error” and <message>
61
+	 * 	will contain a detailed description:
62
+	 * 		<LiteSpeed_eService>
63
+	 * 			<action>Order</action>
64
+	 * 			<result>error</result>
65
+	 * 			<message>Invalid cpu!</message>
66
+	 * 		</LiteSpeed_eService>
67
+	 * 	If the transaction cannot be completed, <result> will be “incomplete”. For example, if
68
+	 * 	payment method is “credit”, but there is not enough credit in your account, or if payment method
69
+	 * 	is “creditcard”, but the charge cannot go through, then the transaction will not be completed
70
+	 * 	and <result> will display “incomplete”. <license_id> and <invoice> will be provided. You will
71
+	 * 	need to login to LiteSpeed’s online store and pay the invoice to finish the order.
72
+	 * 		If payment method is “credit”, but not enough credit is available to your account:
73
+	 * 			<LiteSpeed_eService>
74
+	 * 				<action>Order</action>
75
+	 * 					<license_id>6066</license_id>
76
+	 * 				<license_type>WS_L_V</license_type>
77
+	 * 				<invoice_id>12466</invoice_id>
78
+	 * 				<result>incomplete</result>
79
+	 * 				<message>need to pay invoice first</message>
80
+	 * 			</LiteSpeed_eService>
81
+	 * 		If payment method is “creditcard”, but the attempted credit card payment failed:
82
+	 * 			<LiteSpeed_eService>
83
+	 * 				<action>Order</action>
84
+	 * 				<license_id>9329</license_id>
85
+	 * 				<license_type>WS_L_V</license_type>
86
+	 * 				<invoice_id>20568</invoice_id>
87
+	 * 				<result>incomplete</result>
88
+	 * 				<message>need to pay invoice first, credit card payment failed</message>
89
+	 * 			</LiteSpeed_eService>
90
+	 * 	If the transaction is successful, which should happen for the majority of cases, you will get a
91
+	 * 	serial number back. You can parse the message to get the serial number and create your own script
92
+	 * 	for installation. You will still receive the same confirmation email and serial number emails as
93
+	 * 	if you ordered online. There will be no <invoice_id> if the charge was paid with credit.
94
+	 * 		<LiteSpeed_eService>
95
+	 * 			<action>Order</action>
96
+	 * 			< license_id>6067</ license_id>
97
+	 * 			<license_type>WS_L_V</license_type>
98
+	 * 			<invoice_id>12466</invoice_id>
99
+	 * 			< license_serial>gv06-kXsU-SHBr-pL4N</license_serial>
100
+	 * 			<result>success</result>
101
+	 * 			<message>new order automatically accepted</message>
102
+	 * 		</LiteSpeed_eService>
103
+	 *
104
+	 */
105 105
 
106 106
 	/**
107
-	* Order a LiteSpeed License
108
-	*
109
-	* @param mixed $product  Product type. Available values: “LSWS” or “LSLB”.
110
-	* @param mixed $cpu What kind of license. Available values: “1”: 1-CPU license, “2”: 2-CPU license,  “4”: 4-CPU license, “8”: 8-CPU license, “V”: VPS license, “U”: Ultra-VPS license (Available LSWS 4.2.2 and above.), If <order_product> is “LSLB”, <order_cpu> is not required.
111
-	* @param mixed $period  Renewal period. Available values: “monthly”, “yearly”, “owned”.
112
-	* @param mixed $payment Payment method. Available values: “credit”: Use account credit. User can utilize “Add funds” function to pre-deposit money, which will show up as account credit.      “creditcard”: Use credit card to pay. The credit card is pre-defined in the account.  If there is available credit in the account, credit will be applied first, even when the payment method is set to “creditcard”.
113
-	* @param mixed $cvv  (optional) Credit card security code. Try not to set this field. Only if your bank requires this (meaning that the transaction will fail without it) should you then supply this field. CVV code is not stored in the system, so if you need to set it, you have to set this field every time. Other information from your credit card will be taken from your user account.
114
-	* @param mixed $promocode  (optional) Promotional code. If you have a pre-assigned promotional code registered to your account, then you can set it here. Promotional codes are exclusive to each client. If your account is entitled to discounts at the invoice level, you do not need a promotional code.
115
-	* @return array array with the output result. see above for description of output.
116
-	* 		array (
117
-	* 			'LiteSpeed_eService' => array (
118
-	* 				'action' => 'Order',
119
-	* 				'license_id' => '36514',
120
-	* 				'license_type' => 'WS_L_1',
121
-	* 				'invoice_id' => '86300',
122
-	* 				'result' => 'incomplete',
123
-	* 				'message' => 'Invoice 86300 not paid. ',
124
-	* 			),
125
-	* 		)
126
-	*/
107
+	 * Order a LiteSpeed License
108
+	 *
109
+	 * @param mixed $product  Product type. Available values: “LSWS” or “LSLB”.
110
+	 * @param mixed $cpu What kind of license. Available values: “1”: 1-CPU license, “2”: 2-CPU license,  “4”: 4-CPU license, “8”: 8-CPU license, “V”: VPS license, “U”: Ultra-VPS license (Available LSWS 4.2.2 and above.), If <order_product> is “LSLB”, <order_cpu> is not required.
111
+	 * @param mixed $period  Renewal period. Available values: “monthly”, “yearly”, “owned”.
112
+	 * @param mixed $payment Payment method. Available values: “credit”: Use account credit. User can utilize “Add funds” function to pre-deposit money, which will show up as account credit.      “creditcard”: Use credit card to pay. The credit card is pre-defined in the account.  If there is available credit in the account, credit will be applied first, even when the payment method is set to “creditcard”.
113
+	 * @param mixed $cvv  (optional) Credit card security code. Try not to set this field. Only if your bank requires this (meaning that the transaction will fail without it) should you then supply this field. CVV code is not stored in the system, so if you need to set it, you have to set this field every time. Other information from your credit card will be taken from your user account.
114
+	 * @param mixed $promocode  (optional) Promotional code. If you have a pre-assigned promotional code registered to your account, then you can set it here. Promotional codes are exclusive to each client. If your account is entitled to discounts at the invoice level, you do not need a promotional code.
115
+	 * @return array array with the output result. see above for description of output.
116
+	 * 		array (
117
+	 * 			'LiteSpeed_eService' => array (
118
+	 * 				'action' => 'Order',
119
+	 * 				'license_id' => '36514',
120
+	 * 				'license_type' => 'WS_L_1',
121
+	 * 				'invoice_id' => '86300',
122
+	 * 				'result' => 'incomplete',
123
+	 * 				'message' => 'Invoice 86300 not paid. ',
124
+	 * 			),
125
+	 * 		)
126
+	 */
127 127
 	public function order($product, $cpu = false, $period = 'monthly', $payment = 'credit', $cvv = false, $promocode = false) {
128 128
 		if (!in_array($product, $this->valid_products)) {
129 129
 			return array('error' => 'Invalid Product');
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,8 +14,7 @@
 block discarded – undo
14 14
  *
15 15
  * @access public
16 16
  */
17
-class LiteSpeed
18
-{
17
+class LiteSpeed {
19 18
 
20 19
 	public $login = '';
21 20
 	public $password = '';
Please login to merge, or discard this patch.