PHP Class Faker\Provider\Text

Inheritance: extends Faker\Provider\Base
Afficher le fichier Open project: fzaninotto/faker Class Usage Examples

Protected Properties

Свойство Type Description
$baseText
$consecutiveWords
$explodedText
$separator
$separatorLen
$textStartsWithUppercase

Méthodes publiques

Méthode Description
realText ( integer $maxNbChars = 200, integer $indexSize = 2 ) : string Generate a text string by the Markov chain algorithm.

Méthodes protégées

Méthode Description
appendEnd ( $text )
explode ( $text )
getConsecutiveWords ( $indexSize )
getExplodedText ( )
implode ( $words )
strlen ( $text )
validStart ( $word )

Method Details

appendEnd() protected static méthode

protected static appendEnd ( $text )

explode() protected static méthode

protected static explode ( $text )

getConsecutiveWords() protected méthode

protected getConsecutiveWords ( $indexSize )

getExplodedText() protected méthode

protected getExplodedText ( )

implode() protected static méthode

protected static implode ( $words )

realText() public méthode

Depending on the $maxNbChars, returns a random valid looking text. The algorithm generates a weighted table with the specified number of words as the index and the possible following words as the value.
public realText ( integer $maxNbChars = 200, integer $indexSize = 2 ) : string
$maxNbChars integer Maximum number of characters the text should contain (minimum: 10)
$indexSize integer Determines how many words are considered for the generation of the next word. The minimum is 1, and it produces the higher level of randomness, although the generated text usually doesn't make sense. Higher index sizes (up to 5) produce more correct text, at the price of less randomness.
Résultat string

strlen() protected static méthode

protected static strlen ( $text )

validStart() protected static méthode

protected static validStart ( $word )

Property Details

$baseText protected_oe static_oe property

protected static $baseText

$consecutiveWords protected_oe property

protected $consecutiveWords

$explodedText protected_oe property

protected $explodedText

$separator protected_oe static_oe property

protected static $separator

$separatorLen protected_oe static_oe property

protected static $separatorLen

$textStartsWithUppercase protected_oe static_oe property

protected static $textStartsWithUppercase