Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
magento2-base
setup
src
Magento
Setup
Model
Description
Mixin
Helper
RandomWordSelector.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Setup\Model\Description\Mixin\Helper
;
7
11
class
RandomWordSelector
12
{
20
public
function
getRandomWords
(
$source
,
$count
)
21
{
22
$words = str_word_count(
$source
, 1);
23
if
(empty($words)) {
24
return
[];
25
}
26
27
$randWords = [];
28
$wordsSize = count($words);
29
while
(
$count
) {
30
$randWords[] = $words[random_int(0, $wordsSize - 1)];
31
$count
--;
32
}
33
34
return
$randWords;
35
}
36
}
$source
$source
Definition:
source.php:23
$count
$count
Definition:
recent.phtml:13
Magento\Setup\Model\Description\Mixin\Helper
Definition:
RandomWordSelector.php:6
Magento\Setup\Model\Description\Mixin\Helper\RandomWordSelector
Definition:
RandomWordSelector.php:11
Magento\Setup\Model\Description\Mixin\Helper\RandomWordSelector\getRandomWords
getRandomWords($source, $count)
Definition:
RandomWordSelector.php:20