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

Commit

Permalink
Merge pull request #778 from LagunaJavier/master
Browse files Browse the repository at this point in the history
Text Provider ensure text starts with an uppercase letter #527
  • Loading branch information
fzaninotto committed Feb 23, 2016
2 parents e150dea + 5387839 commit d9387d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Faker/Provider/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ abstract class Text extends Base
protected static $separatorLen = 1;
protected $explodedText;
protected $consecutiveWords = array();
protected static $textStartsWithUppercase = true;

/**
* Generate a text string by the Markov chain algorithm.
Expand Down Expand Up @@ -127,7 +128,11 @@ protected static function strlen($text)

protected static function validStart($word)
{
return preg_match('/^\p{Lu}/u', $word);
$isValid = true;
if (self::$textStartsWithUppercase) {
$isValid = preg_match('/^\p{Lu}/u', $word);
}
return $isValid;
}

protected static function appendEnd($text)
Expand Down

0 comments on commit d9387d3

Please sign in to comment.