Skip to content

Commit

Permalink
IdnaEncoder::to_ascii(): add select @codeCoverageIgnore annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Sep 17, 2021
1 parent 64f7a28 commit fe68365
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/IdnaEncoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,17 @@ public static function to_ascii($string) {
// Step 4: Check if it's ASCII now
if (self::is_ascii($string)) {
// Skip to step 7
/*
* As the `nameprep()` method returns the original string, this code will never be reached until
* that method is properly implemented.
*/
// @codeCoverageIgnoreStart
if (strlen($string) < self::MAX_LENGTH) {
return $string;
}

throw new Exception('Prepared string is too long', 'idna.prepared_too_long', $string);
// @codeCoverageIgnoreEnd
}

// Step 5: Check ACE prefix
Expand Down

0 comments on commit fe68365

Please sign in to comment.