Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Tweak check for presence of letters
Browse files Browse the repository at this point in the history
Faster, maybe simpler?
  • Loading branch information
vlakoff committed Dec 17, 2016
1 parent 646a1a8 commit 11ee86c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Faker/Provider/Internet.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function userName()
$username = strtolower(static::transliterate($username));

// check if transliterate() didn't support the language and removed all letters
if (preg_match('/^[._]*$/', $username)) {
if (trim($username, '._') === '') {
throw new \Exception('userName failed with the selected locale. Try a different locale or activate the "intl" PHP extension.');
}

Expand Down Expand Up @@ -134,7 +134,7 @@ public function domainWord()
$lastName = strtolower(static::transliterate($lastName));

// check if transliterate() didn't support the language and removed all letters
if (preg_match('/^[._]*$/', $lastName)) {
if (trim($lastName, '._') === '') {
throw new \Exception('domainWord failed with the selected locale. Try a different locale or activate the "intl" PHP extension.');
}

Expand Down

0 comments on commit 11ee86c

Please sign in to comment.