Passed
Push — master ( 50ef80...e38a1a )
by Joe
02:49
created
bin/list_expired_licenses.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,14 +7,14 @@
 block discarded – undo
7 7
 $licenses = $cpl->fetchExpiredLicenses();
8 8
 
9 9
 foreach ($licenses->licenses as $lisc) {
10
-    $lisc = (array) $lisc;
11
-    print "\nLicense IP: ".$lisc['@attributes']['ip']."\n";
12
-    print "        ID: ".$lisc['@attributes']['name']."\n";
13
-    print "   groupid: ".$lisc['@attributes']['groupid']."\n";
14
-    print " packageid: ".$lisc['@attributes']['packageid']."\n";
15
-    print "   adddate: ".$lisc['@attributes']['adddate']."\n";
16
-    print "expired on: ".$lisc['@attributes']['expiredon']."\n";
17
-    print "    reason: ".$lisc['@attributes']['expirereason']."\n";
10
+	$lisc = (array) $lisc;
11
+	print "\nLicense IP: ".$lisc['@attributes']['ip']."\n";
12
+	print "        ID: ".$lisc['@attributes']['name']."\n";
13
+	print "   groupid: ".$lisc['@attributes']['groupid']."\n";
14
+	print " packageid: ".$lisc['@attributes']['packageid']."\n";
15
+	print "   adddate: ".$lisc['@attributes']['adddate']."\n";
16
+	print "expired on: ".$lisc['@attributes']['expiredon']."\n";
17
+	print "    reason: ".$lisc['@attributes']['expirereason']."\n";
18 18
 }
19 19
 
20 20
 
Please login to merge, or discard this patch.
bin/expire_license.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -8,15 +8,15 @@
 block discarded – undo
8 8
 $liscid = $lisc["@attributes"]["licenseid"];
9 9
 
10 10
 if ($liscid > 0) {
11
-    $expire = (array) $cpl->expireLicense(array(
12
-        liscid => $liscid,
13
-        reason => "Automagic Expiration",
14
-        expcode => "normal"
15
-        )
16
-    );
17
-    print $expire["@attributes"]["result"]."\n";
11
+	$expire = (array) $cpl->expireLicense(array(
12
+		liscid => $liscid,
13
+		reason => "Automagic Expiration",
14
+		expcode => "normal"
15
+		)
16
+	);
17
+	print $expire["@attributes"]["result"]."\n";
18 18
 } else {
19
-    print "There is no valid license for $ip\n";
19
+	print "There is no valid license for $ip\n";
20 20
 }
21 21
 
22 22
 
Please login to merge, or discard this patch.
bin/fetch_risk_data.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,16 +5,16 @@
 block discarded – undo
5 5
 $ip = "__IP__";
6 6
 
7 7
 // This is only useful to cPanel Distributors
8
-$status = (array)$cpl->fetchLicenseRiskData(array(
8
+$status = (array) $cpl->fetchLicenseRiskData(array(
9 9
 	"ip" => $ip
10 10
 	)
11 11
 );
12 12
 
13 13
 if ($status["@attributes"]["status"] == 1) {
14 14
    print "Risk Scores for $ip:\n";
15
-   print "aggregate : " . $status["@attributes"]["riskscore.aggregate.score"] . "\n";
16
-   print "directorder : " . $status["@attributes"]["riskscore.directorder.score"] . "\n";
17
-   print "main : " . $status["@attributes"]["riskscore.main.score"] . "\n";
15
+   print "aggregate : ".$status["@attributes"]["riskscore.aggregate.score"]."\n";
16
+   print "directorder : ".$status["@attributes"]["riskscore.directorder.score"]."\n";
17
+   print "main : ".$status["@attributes"]["riskscore.main.score"]."\n";
18 18
 } else {
19 19
    print "Failed to fetch risk data\n";
20 20
 }
Please login to merge, or discard this patch.
bin/add_new_license.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -2,14 +2,14 @@  discard block
 block discarded – undo
2 2
 
3 3
 include("../cpl.inc.php");
4 4
 
5
-$cpl = new \Detain\Cpanel\Cpanel( $_SERVER['argv'][1], $_SERVER['argv'][2] );
5
+$cpl = new \Detain\Cpanel\Cpanel($_SERVER['argv'][1], $_SERVER['argv'][2]);
6 6
 
7 7
 $ip = "__IP__";
8 8
 
9
-$groupid = $cpl->findKey("__GROUPNAME__", $cpl->fetchGroups() );
10
-$packageid = $cpl->findKey("__PACKAGENAME__", $cpl->fetchPackages() );
9
+$groupid = $cpl->findKey("__GROUPNAME__", $cpl->fetchGroups());
10
+$packageid = $cpl->findKey("__PACKAGENAME__", $cpl->fetchPackages());
11 11
 
12
-$lisc = (array)$cpl->activateLicense(array(
12
+$lisc = (array) $cpl->activateLicense(array(
13 13
 		"ip" => $ip,
14 14
 		"groupid" => $groupid,
15 15
 		"packageid" => $packageid,
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
 );
22 22
 
23 23
 if ($lisc['@attributes']['status'] > 0) {
24
-	print "license added with id: ". $lisc['@attributes']['licenseid'] . "\n";
24
+	print "license added with id: ".$lisc['@attributes']['licenseid']."\n";
25 25
 } else {
26
-	print "License add failed: " . $lisc['@attributes']['reason'] . "\n";
26
+	print "License add failed: ".$lisc['@attributes']['reason']."\n";
27 27
 }
28 28
 
Please login to merge, or discard this patch.
src/Cpanel.php 2 patches
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -27,8 +27,7 @@  discard block
 block discarded – undo
27 27
 		if ($format != "xml" && $format != "json" && $format != "yaml" && $format != "simplexml") {
28 28
 			error_log("set_format requires that the format is xml, json, yaml or simplexml");
29 29
 			return;
30
-		}
31
-		else {
30
+		} else {
32 31
 			$this->format = $format;
33 32
 		}
34 33
 	}
@@ -59,8 +58,7 @@  discard block
 block discarded – undo
59 58
 			$result = $result[str_replace('.cgi', '', $function)];
60 59
 			$result = $this->format_result($result);			
61 60
 			return $result;
62
-		}
63
-		else {
61
+		} else {
64 62
 			return $result;
65 63
 		}
66 64
 	}
@@ -88,8 +86,7 @@  discard block
 block discarded – undo
88 86
 	private function validateID($id) {
89 87
 		if (preg_match("/^(L|P|G)?\d*$/", $id)) {
90 88
 			return 1;
91
-		}
92
-		else {
89
+		} else {
93 90
 			return 0;
94 91
 		}
95 92
 	}
@@ -273,11 +270,9 @@  discard block
 block discarded – undo
273 270
 		$xmlObj = (array) $xmlObj;
274 271
 		if (array_key_exists("packages", $xmlObj)) {
275 272
 			$type = "packages";
276
-		}
277
-		else if (array_key_exists("groups", $xmlObj)) {
273
+		} else if (array_key_exists("groups", $xmlObj)) {
278 274
 			$type = "groups";
279
-		}
280
-		else {
275
+		} else {
281 276
 			error_log("cPanelLicensing::findKey with an object that is not groups or packages");
282 277
 			return;
283 278
 		}
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
 		}
50 50
 		$result = curl_exec($this->curl);
51 51
 		curl_close($this->curl);
52
-		if ($result == false) {
52
+		if ($result == FALSE) {
53 53
 			error_log("cPanelLicensing::get failed: \"".curl_error($this->curl)."\"");
54 54
 			return;
55 55
 		}
Please login to merge, or discard this patch.