Code Duplication    Length = 11-12 lines in 3 locations

src/Cpanel.php 3 locations

@@ 134-144 (lines=11) @@
131
		return $this->get("XMLonetimeext.cgi", $args);
132
	}
133
134
	public function changeip($args) {
135
		if (!array_key_exists("oldip", $args) || !array_key_exists("newip", $args)) {
136
			error_log("cpanelLicensing::changeip requires that oldip and newip elements exist in the array passed to it");
137
			return;
138
		}
139
		if (!$this->validateIP($args["newip"])) {
140
			error_log("the newip passed to cpanelLicensing::changeip was invalid");
141
			return;
142
		}
143
		return $this->get("XMLtransfer.cgi", $args);
144
	}
145
146
	public function requestTransfer($args) {
147
		if (!array_key_exists("ip", $args) || !array_key_exists("groupid", $args) || !array_key_exists("packagegroup", $args)) {
@@ 231-242 (lines=12) @@
228
		return $this->get("XMLsecverify.cgi", $args);
229
	}
230
231
	public function fetchLicenseRaw($args) {
232
		$args = array_merge(array("all" => 1), $args);
233
		if (!array_key_exists("ip", $args)) {
234
			error_log("cpanelLicesning::fetchLicenseRaw requires that ip exists as an element in the array is passed to it");
235
			return;
236
		}
237
		if (!$this->validateIP($args['ip'])) {
238
			error_log("cpanelLicensing::fetchLicenseRaw was passed an invalid ip");
239
			return;
240
		}
241
		return $this->get("XMLRawlookup.cgi", $args);
242
	}
243
244
	public function fetchLicenseId($args) {
245
		$args = array_merge(array("all" => 1), $args);
@@ 244-255 (lines=12) @@
241
		return $this->get("XMLRawlookup.cgi", $args);
242
	}
243
244
	public function fetchLicenseId($args) {
245
		$args = array_merge(array("all" => 1), $args);
246
		if (!array_key_exists('ip', $args)) {
247
			error_log("cpanelLicensing::getLicenseId requires that an IP is passed to it");
248
			return;
249
		}
250
		if (!$this->validateIP($args['ip'])) {
251
			error_log("cpanelLicensing::fetchLicenseId was passed an invalid ip");
252
			return;
253
		}
254
		return $this->get("XMLlookup.cgi", $args);
255
	}
256
257
	public function fetchPackages() {
258
		return $this->get("XMLpackageInfo.cgi");