Code Duplication    Length = 12-13 lines in 2 locations

engine/classes/ElggPluginPackage.php 2 locations

@@ 565-576 (lines=12) @@
562
	 * @param bool  $inverse      Inverse the result to use as a conflicts.
563
	 * @return bool
564
	 */
565
	private function checkDepElgg(array $dep, $elgg_version, $inverse = false) {
566
		$status = version_compare($elgg_version, $dep['version'], $dep['comparison']);
567
568
		if ($inverse) {
569
			$status = !$status;
570
		}
571
572
		return array(
573
			'status' => $status,
574
			'value' => $elgg_version
575
		);
576
	}
577
578
	/**
579
	 * Checks if $php_version meets the requirement by $dep.
@@ 585-597 (lines=13) @@
582
	 * @param bool  $inverse Inverse the result to use as a conflicts.
583
	 * @return bool
584
	 */
585
	private function checkDepPhpVersion(array $dep, $inverse = false) {
586
		$php_version = phpversion();
587
		$status = version_compare($php_version, $dep['version'], $dep['comparison']);
588
589
		if ($inverse) {
590
			$status = !$status;
591
		}
592
593
		return array(
594
			'status' => $status,
595
			'value' => $php_version
596
		);
597
	}
598
599
	/**
600
	 * Checks if the PHP extension in $dep is loaded.