Code Duplication    Length = 8-8 lines in 2 locations

library/Requests/IDNAEncoder.php 2 locations

@@ 66-73 (lines=8) @@
63
	 */
64
	public static function to_ascii($string) {
65
		// Step 1: Check if the string is already ASCII
66
		if (self::is_ascii($string)) {
67
			// Skip to step 7
68
			if (strlen($string) < 64) {
69
				return $string;
70
			}
71
72
			throw new Exception('Provided string is too long', 'idna.provided_too_long', $string);
73
		}
74
75
		// Step 2: nameprep
76
		$string = self::nameprep($string);
@@ 80-87 (lines=8) @@
77
78
		// Step 3: UseSTD3ASCIIRules is false, continue
79
		// Step 4: Check if it's ASCII now
80
		if (self::is_ascii($string)) {
81
			// Skip to step 7
82
			if (strlen($string) < 64) {
83
				return $string;
84
			}
85
86
			throw new Exception('Prepared string is too long', 'idna.prepared_too_long', $string);
87
		}
88
89
		// Step 5: Check ACE prefix
90
		if (strpos($string, self::ACE_PREFIX) === 0) {