PHP 8.2.30
Preview: Lorem.php Size: 7.70 KB
/home/byroehnu/easetack.com/vendor/fakerphp/faker/src/Faker/Provider/Lorem.php

<?php

namespace Faker\Provider;

class Lorem extends Base
{
    protected static $wordList = [
        'alias', 'consequatur', 'aut', 'perferendis', 'sit', 'voluptatem',
        'accusantium', 'doloremque', 'aperiam', 'eaque', 'ipsa', 'quae', 'ab',
        'illo', 'inventore', 'veritatis', 'et', 'quasi', 'architecto',
        'beatae', 'vitae', 'dicta', 'sunt', 'explicabo', 'aspernatur', 'aut',
        'odit', 'aut', 'fugit', 'sed', 'quia', 'consequuntur', 'magni',
        'dolores', 'eos', 'qui', 'ratione', 'voluptatem', 'sequi', 'nesciunt',
        'neque', 'dolorem', 'ipsum', 'quia', 'dolor', 'sit', 'amet',
        'consectetur', 'adipisci', 'velit', 'sed', 'quia', 'non', 'numquam',
        'eius', 'modi', 'tempora', 'incidunt', 'ut', 'labore', 'et', 'dolore',
        'magnam', 'aliquam', 'quaerat', 'voluptatem', 'ut', 'enim', 'ad',
        'minima', 'veniam', 'quis', 'nostrum', 'exercitationem', 'ullam',
        'corporis', 'nemo', 'enim', 'ipsam', 'voluptatem', 'quia', 'voluptas',
        'sit', 'suscipit', 'laboriosam', 'nisi', 'ut', 'aliquid', 'ex', 'ea',
        'commodi', 'consequatur', 'quis', 'autem', 'vel', 'eum', 'iure',
        'reprehenderit', 'qui', 'in', 'ea', 'voluptate', 'velit', 'esse',
        'quam', 'nihil', 'molestiae', 'et', 'iusto', 'odio', 'dignissimos',
        'ducimus', 'qui', 'blanditiis', 'praesentium', 'laudantium', 'totam',
        'rem', 'voluptatum', 'deleniti', 'atque', 'corrupti', 'quos',
        'dolores', 'et', 'quas', 'molestias', 'excepturi', 'sint',
        'occaecati', 'cupiditate', 'non', 'provident', 'sed', 'ut',
        'perspiciatis', 'unde', 'omnis', 'iste', 'natus', 'error',
        'similique', 'sunt', 'in', 'culpa', 'qui', 'officia', 'deserunt',
        'mollitia', 'animi', 'id', 'est', 'laborum', 'et', 'dolorum', 'fuga',
        'et', 'harum', 'quidem', 'rerum', 'facilis', 'est', 'et', 'expedita',
        'distinctio', 'nam', 'libero', 'tempore', 'cum', 'soluta', 'nobis',
        'est', 'eligendi', 'optio', 'cumque', 'nihil', 'impedit', 'quo',
        'porro', 'quisquam', 'est', 'qui', 'minus', 'id', 'quod', 'maxime',
        'placeat', 'facere', 'possimus', 'omnis', 'voluptas', 'assumenda',
        'est', 'omnis', 'dolor', 'repellendus', 'temporibus', 'autem',
        'quibusdam', 'et', 'aut', 'consequatur', 'vel', 'illum', 'qui',
        'dolorem', 'eum', 'fugiat', 'quo', 'voluptas', 'nulla', 'pariatur',
        'at', 'vero', 'eos', 'et', 'accusamus', 'officiis', 'debitis', 'aut',
        'rerum', 'necessitatibus', 'saepe', 'eveniet', 'ut', 'et',
        'voluptates', 'repudiandae', 'sint', 'et', 'molestiae', 'non',
        'recusandae', 'itaque', 'earum', 'rerum', 'hic', 'tenetur', 'a',
        'sapiente', 'delectus', 'ut', 'aut', 'reiciendis', 'voluptatibus',
        'maiores', 'doloribus', 'asperiores', 'repellat',
    ];

    /**
     * @example 'Lorem'
     *
     * @return string
     */
    public static function word()
    {
        return static::randomElement(static::$wordList);
    }

    /**
     * Generate an array of random words
     *
     * @example array('Lorem', 'ipsum', 'dolor')
     *
     * @param int  $nb     how many words to return
     * @param bool $asText if true the sentences are returned as one string
     *
     * @return array|string
     */
    public static function words($nb = 3, $asText = false)
    {
        $words = [];

        for ($i = 0; $i < $nb; ++$i) {
            $words[] = static::word();
        }

        return $asText ? implode(' ', $words) : $words;
    }

    /**
     * Generate a random sentence
     *
     * @example 'Lorem ipsum dolor sit amet.'
     *
     * @param int  $nbWords         around how many words the sentence should contain
     * @param bool $variableNbWords set to false if you want exactly $nbWords returned,
     *                              otherwise $nbWords may vary by +/-40% with a minimum of 1
     *
     * @return string
     */
    public static function sentence($nbWords = 6, $variableNbWords = true)
    {
        if ($nbWords <= 0) {
            return '';
        }

        if ($variableNbWords) {
            $nbWords = self::randomizeNbElements($nbWords);
        }

        $words = static::words($nbWords);
        $words[0] = ucwords($words[0]);

        return implode(' ', $words) . '.';
    }

    /**
     * Generate an array of sentences
     *
     * @example array('Lorem ipsum dolor sit amet.', 'Consectetur adipisicing eli.')
     *
     * @param int  $nb     how many sentences to return
     * @param bool $asText if true the sentences are returned as one string
     *
     * @return array|string
     */
    public static function sentences($nb = 3, $asText = false)
    {
        $sentences = [];

        for ($i = 0; $i < $nb; ++$i) {
            $sentences[] = static::sentence();
        }

        return $asText ? implode(' ', $sentences) : $sentences;
    }

    /**
     * Generate a single paragraph
     *
     * @example 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.'
     *
     * @param int  $nbSentences         around how many sentences the paragraph should contain
     * @param bool $variableNbSentences set to false if you want exactly $nbSentences returned,
     *                                  otherwise $nbSentences may vary by +/-40% with a minimum of 1
     *
     * @return string
     */
    public static function paragraph($nbSentences = 3, $variableNbSentences = true)
    {
        if ($nbSentences <= 0) {
            return '';
        }

        if ($variableNbSentences) {
            $nbSentences = self::randomizeNbElements($nbSentences);
        }

        return implode(' ', static::sentences($nbSentences));
    }

    /**
     * Generate an array of paragraphs
     *
     * @example array($paragraph1, $paragraph2, $paragraph3)
     *
     * @param int  $nb     how many paragraphs to return
     * @param bool $asText if true the paragraphs are returned as one string, separated by two newlines
     *
     * @return array|string
     */
    public static function paragraphs($nb = 3, $asText = false)
    {
        $paragraphs = [];

        for ($i = 0; $i < $nb; ++$i) {
            $paragraphs[] = static::paragraph();
        }

        return $asText ? implode("\n\n", $paragraphs) : $paragraphs;
    }

    /**
     * Generate a text string.
     * Depending on the $maxNbChars, returns a string made of words, sentences, or paragraphs.
     *
     * @example 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.'
     *
     * @param int $maxNbChars Maximum number of characters the text should contain (minimum 5)
     *
     * @return string
     */
    public static function text($maxNbChars = 200)
    {
        if ($maxNbChars < 5) {
            throw new \InvalidArgumentException('text() can only generate text of at least 5 characters');
        }

        $type = 'paragraph';

        if ($maxNbChars < 100) {
            $type = 'sentence';
        }

        if ($maxNbChars < 25) {
            $type = 'word';
        }

        $text = [];

        while (empty($text)) {
            $size = 0;

            // until $maxNbChars is reached
            while ($size < $maxNbChars) {
                $word = ($size ? ' ' : '') . static::$type();
                $text[] = $word;

                $size += strlen($word);
            }

            array_pop($text);
        }

        if ($type === 'word') {
            // capitalize first letter
            $text[0] = ucwords($text[0]);

            // end sentence with full stop
            $text[count($text) - 1] .= '.';
        }

        return implode('', $text);
    }

    protected static function randomizeNbElements($nbElements)
    {
        return (int) ($nbElements * self::numberBetween(60, 140) / 100) + 1;
    }
}

Directory Contents

Dirs: 75 × Files: 20

Name Size Perms Modified Actions
ar_EG DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
ar_JO DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
ar_SA DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
at_AT DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
bg_BG DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
bn_BD DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
cs_CZ DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
da_DK DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
de_AT DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
de_CH DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
de_DE DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
el_CY DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
el_GR DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_AU DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_CA DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_GB DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_HK DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_IN DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_NG DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_NZ DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_PH DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_SG DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_UG DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_US DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
en_ZA DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
es_AR DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
es_ES DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
es_PE DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
es_VE DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
et_EE DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
fa_IR DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
fi_FI DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
fr_BE DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
fr_CA DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
fr_CH DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
fr_FR DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
he_IL DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
hr_HR DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
hu_HU DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
hy_AM DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
id_ID DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
is_IS DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
it_CH DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
it_IT DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
ja_JP DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
ka_GE DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
kk_KZ DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
ko_KR DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
lt_LT DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
lv_LV DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
me_ME DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
mn_MN DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
ms_MY DIR
- drwxrwxrwx 2025-05-16 16:14:39
Edit Download
nb_NO DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
ne_NP DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
nl_BE DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
nl_NL DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
pl_PL DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
pt_BR DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
pt_PT DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
ro_MD DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
ro_RO DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
ru_RU DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
sk_SK DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
sl_SI DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
sr_RS DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
sv_SE DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
th_TH DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
tr_TR DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
uk_UA DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
vi_VN DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
zh_CN DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
zh_TW DIR
- drwxrwxrwx 2025-05-16 16:14:40
Edit Download
3.49 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
2.19 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
22.20 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
1.79 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
4.64 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
901 B lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
12.10 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
25.10 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
9.98 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
6.00 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
17.17 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
7.70 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
648 B lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
13.21 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
10.42 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
3.23 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
6.45 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
6.65 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
8.46 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download
1.78 KB lrw-rw-rw- 2024-11-21 13:46:39
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).