Generates a series of sentences
@param integer $minWords The minimum number of words
@param integer  $maxWords The maximum number of words
@return  Text
515486
public function Sentences($minSentences = 1, $maxSentences = null)
    {
        list($min, $max) = $this->resolveMinMax($minSentences, $maxSentences, 5);
        return DBField::create_field("Text", $this->getFaker()->paragraph(rand($min, $max)));
    }
1080136
public function indexSearch($searchText, $maxResults)
    {
        // split the phrase into words
        $words = SearchAnalyser::analyse($searchText);
        if (!$words) {
            return [];
        }

        $query = $this->_em->createQueryBuilder()
            ->select('o')
            ->from($this->_entityName, 'o')
            ->setMaxResults($maxResults);

        $parameters = [];
        foreach ($words as $k => $word) {
            $subquery = $this->_em->createQueryBuilder()
                ->select("i$k.keyword")
                ->from($this->getSearchIndexClass(), "i$k")
                ->where("i$k.object = o")
                ->andWhere("i$k.keyword ILIKE :search$k");
            $query->andWhere($query->expr()->exists($subquery->getDql()));
            $parameters["search$k"] = '%' . $word . '%';
        }
        $query->setParameters($parameters);

        $results = $query->getQuery()->execute();

        return $results;
    }
1073775
public function havingBetween(string $column, int $min, int $max)
    {
        $this->hConditions()->between(...func_get_args());

        return $this;
    }
935261
public function add($words)
    {
        $request = new AddDirtyWordRequest($words);
        $response = new BaseResponse();
        return $this->client->sendRequest($request, $response);
    }
436103
protected function rand($min, $max)
    {
        $this->seed = md5($this->seed);
        $rand = hexdec(substr($this->seed, 0, 8));
        return ($rand % ($max - $min + 1)) + $min;
    }
1174020
protected function generateObjects(int $iterations, int $min, int $max)
    {
        $array = [];

        for ($i = 0; $i < $iterations; ++$i) {
            $array[] = RutHelper::rectify(rand($min, $max));
        }

        return $array;
    }
401924
public function setMinStrings($minStrings)
    {
        if (is_int($minStrings) && $minStrings >= 0) {
            $this->minStrings = $minStrings;
        } else {
            $msg = "The 'minStrings' argument must be a positive (>= 0) integer, '" . gettype($minStrings) . "' given.";
            throw new InvalidArgumentException($msg);
        }
    }
1081147
public function Paragraphs($minVal = 1, $maxVal = null)
    {
        list($min, $max) = $this->resolveMinMax($minVal, $maxVal, 5);
        $paragraphs = rand($min, $max);
        $faker = $this->getFaker();
        $i = 0;
        $html = "";
        while ($i < $paragraphs) {
            $html .= "<p>".$faker->paragraph(rand(2, 6))."</p>";
            $i++;
        }

        return DBField::create_field("HTMLText", $html);
    }
949076
public static function generate(string $text = '', ?int $maxLength = null): string
    {
        $text = StripTags::strip($text);
        $text = \strtolower(\iconv('UTF-8', 'ASCII//TRANSLIT', $text));
        $text = \preg_replace('/[^a-z0-9\-\ ]/', '', $text);
        $text = \preg_replace('/[\s\-]+/', '-', $text);
        if (\is_int($maxLength)) {
            $text = \substr($text, 0, $maxLength);
        }
        $text = \rtrim($text, '-');

        return '/'.$text;
    }
1352870
public function betweenLength($min, $max, $msg)
    {
        $this->minLength($min, $msg);
        $this->maxLength($max, $msg);
        return $this;
    }
960904
public function havingBetween(string $column, int $min, int $max)
    {
        $instance = $this->havingStrategyInstance();

        $instance->havingStrategy()->havingBetween($column, $min, $max);

        return $instance;
    }
683738
public function between($min, $max)
    {
        $this->doCheck(function ($value) use ($min, $max) {
            $this->throwExceptionIfFalse(
                $this->isBetween($value, $min, $max),
                'Failed assertion that %s is between %s and %s', $value, $min, $max
            );
        });

        return $this;
    }
635677
public static String phrase(int minSize, int maxSize) {
        maxSize = Math.max(minSize, maxSize);
        int size = RandomInteger.nextInteger(minSize, maxSize);
        if (size <= 0) return "";
        
        StringBuilder result = new StringBuilder();
        result.append(RandomString.pick(_allWords));
        while (result.length() < size) {
            result.append(" ").append(RandomString.pick(_allWords).toLowerCase());
        }

        return result.toString();
    }
1239425
public function create(
        $limit,
        $nameWords
    ) {
        $vocabularies = [];
        for ($i = 0; $i < $limit; $i++) {
            try {
                // Create a vocabulary.
                $vocabulary = $this->entityTypeManager->getStorage('taxonomy_vocabulary')->create(
                    [
                        'name' => $this->getRandom()->sentences(mt_rand(1, $nameWords), true),
                        'description' => $this->getRandom()->sentences(mt_rand(1, $nameWords)),
                        'vid' => Unicode::strtolower($this->getRandom()->name()),
                        'langcode' => LanguageInterface::LANGCODE_NOT_SPECIFIED,
                        'weight' => mt_rand(0, 10),
                    ]
                );
                $vocabulary->save();
                $vocabularies['success'][] = [
                    'vid' => $vocabulary->id(),
                    'vocabulary' => $vocabulary->get('name'),
                ];
            } catch (\Exception $error) {
                $vocabularies['error'][] = $error->getMessage();
            }
        }

        return $vocabularies;
    }
1108266
public function upperWords($delimiters = " \t\r\n\f\v")
    {
        return static::of(
            mb_ucwords($this->contents, $delimiters, $this->encoding),
            $this->encoding
        );
    }
386039
public function setMaxNbColumns($maxNbColumns)
    {
        $this->minNbColumns = min($this->minNbColumns, $maxNbColumns);
        $this->maxNbColumns = $maxNbColumns;

        return $this;
    }
176743
public function generate($min = 0, $max = null)
    {  
        if($max === null) {
            $max = 2796203;
        }
        
        if($max > 2796203) {
            throw new ReverseRegexException('Max param has exceeded the maxium 2796203');
        }
        
        if ($this->seed == 0) {
            $this->seed(mt_rand());
        }
        
        $this->seed = ($this->seed * 125) % 2796203;  
        
        
        return $this->seed % ($max - $min + 1) + $min;  
    }