mirror of
https://github.com/fzaninotto/Faker.git
synced 2025-03-14 04:19:47 +01:00
finalizing data providers in arabic
This commit is contained in:
parent
0921304ad8
commit
272fb49b12
File diff suppressed because one or more lines are too long
@ -6,38 +6,25 @@ class Company extends \Faker\Provider\Company
|
||||
{
|
||||
protected static $formats = array(
|
||||
'{{lastName}} {{companySuffix}}',
|
||||
'{{lastName}}-{{lastName}}',
|
||||
'{{lastName}}, {{lastName}} and {{lastName}}'
|
||||
);
|
||||
|
||||
/**
|
||||
* {@link} http://www.earabicmarket.com/earabicmarket/ar/companies/jordan/all/search
|
||||
**/
|
||||
protected static $catchPhraseWords = array(
|
||||
'Adaptive', 'Advanced', 'Ameliorated', 'Assimilated', 'Automated', 'Balanced', 'Business-focused', 'Centralized', 'Cloned', 'Compatible', 'Configurable', 'Cross-group', 'Cross-platform', 'Customer-focused', 'Customizable', 'Decentralized', 'De-engineered', 'Devolved', 'Digitized', 'Distributed', 'Diverse', 'Down-sized', 'Enhanced', 'Enterprise-wide', 'Ergonomic', 'Exclusive', 'Expanded', 'Extended', 'Facetoface', 'Focused', 'Front-line', 'Fully-configurable', 'Function-based', 'Fundamental', 'Future-proofed', 'Grass-roots', 'Horizontal', 'Implemented', 'Innovative', 'Integrated', 'Intuitive', 'Inverse', 'Managed', 'Mandatory', 'Monitored', 'Multi-channelled', 'Multi-lateral', 'Multi-layered', 'Multi-tiered', 'Networked', 'Object-based', 'Open-architected', 'Open-source', 'Operative', 'Optimized', 'Optional', 'Organic', 'Organized', 'Persevering', 'Persistent', 'Phased', 'Polarised', 'Pre-emptive', 'Proactive', 'Profit-focused', 'Profound', 'Programmable', 'Progressive', 'Public-key', 'Quality-focused', 'Reactive', 'Realigned', 'Re-contextualized', 'Re-engineered', 'Reduced', 'Reverse-engineered', 'Right-sized', 'Robust', 'Seamless', 'Secured', 'Self-enabling', 'Sharable', 'Stand-alone', 'Streamlined', 'Switchable', 'Synchronised', 'Synergistic', 'Synergized', 'Team-oriented', 'Total', 'Triple-buffered', 'Universal', 'Up-sized', 'Upgradable', 'User-centric', 'User-friendly', 'Versatile', 'Virtual', 'Visionary', 'Vision-oriented'
|
||||
),
|
||||
array(
|
||||
'24hour', '24/7', '3rdgeneration', '4thgeneration', '5thgeneration', '6thgeneration', 'actuating', 'analyzing', 'assymetric', 'asynchronous', 'attitude-oriented', 'background', 'bandwidth-monitored', 'bi-directional', 'bifurcated', 'bottom-line', 'clear-thinking', 'client-driven', 'client-server', 'coherent', 'cohesive', 'composite', 'context-sensitive', 'contextually-based', 'content-based', 'dedicated', 'demand-driven', 'didactic', 'directional', 'discrete', 'disintermediate', 'dynamic', 'eco-centric', 'empowering', 'encompassing', 'even-keeled', 'executive', 'explicit', 'exuding', 'fault-tolerant', 'foreground', 'fresh-thinking', 'full-range', 'global', 'grid-enabled', 'heuristic', 'high-level', 'holistic', 'homogeneous', 'human-resource', 'hybrid', 'impactful', 'incremental', 'intangible', 'interactive', 'intermediate', 'leadingedge', 'local', 'logistical', 'maximized', 'methodical', 'mission-critical', 'mobile', 'modular', 'motivating', 'multimedia', 'multi-state', 'multi-tasking', 'national', 'needs-based', 'neutral', 'nextgeneration', 'non-volatile', 'object-oriented', 'optimal', 'optimizing', 'radical', 'real-time', 'reciprocal', 'regional', 'responsive', 'scalable', 'secondary', 'solution-oriented', 'stable', 'static', 'systematic', 'systemic', 'system-worthy', 'tangible', 'tertiary', 'transitional', 'uniform', 'upward-trending', 'user-facing', 'value-added', 'web-enabled', 'well-modulated', 'zeroadministration', 'zerodefect', 'zerotolerance'
|
||||
),
|
||||
|
||||
array(
|
||||
'ability', 'access', 'adapter', 'algorithm', 'alliance', 'analyzer', 'application', 'approach', 'architecture', 'archive', 'artificialintelligence', 'array', 'attitude', 'benchmark', 'budgetarymanagement', 'capability', 'capacity', 'challenge', 'circuit', 'collaboration', 'complexity', 'concept', 'conglomeration', 'contingency', 'core', 'customerloyalty', 'database', 'data-warehouse', 'definition', 'emulation', 'encoding', 'encryption', 'extranet', 'firmware', 'flexibility', 'focusgroup', 'forecast', 'frame', 'framework', 'function', 'functionalities', 'GraphicInterface', 'groupware', 'GraphicalUserInterface', 'hardware', 'help-desk', 'hierarchy', 'hub', 'implementation', 'info-mediaries', 'infrastructure', 'initiative', 'installation', 'instructionset', 'interface', 'internetsolution', 'intranet', 'knowledgeuser', 'knowledgebase', 'localareanetwork', 'leverage', 'matrices', 'matrix', 'methodology', 'middleware', 'migration', 'model', 'moderator', 'monitoring', 'moratorium', 'neural-net', 'openarchitecture', 'opensystem', 'orchestration', 'paradigm', 'parallelism', 'policy', 'portal', 'pricingstructure', 'processimprovement', 'product', 'productivity', 'project', 'projection', 'protocol', 'securedline', 'service-desk', 'software', 'solution', 'standardization', 'strategy', 'structure', 'success', 'superstructure', 'support', 'synergy', 'systemengine', 'task-force', 'throughput', 'time-frame', 'toolset', 'utilisation', 'website', 'workforce'
|
||||
)
|
||||
'{{companyPrefix}} {{lastName}} {{companySuffix}}',
|
||||
'{{companyPrefix}} {{lastName}}',
|
||||
);
|
||||
|
||||
protected static $bsWords = array(
|
||||
array(
|
||||
'implement', 'utilize', 'integrate', 'streamline', 'optimize', 'evolve', 'transform', 'embrace', 'enable', 'orchestrate', 'leverage', 'reinvent', 'aggregate', 'architect', 'enhance', 'incentivize', 'morph', 'empower', 'envisioneer', 'monetize', 'harness', 'facilitate', 'seize', 'disintermediate', 'synergize', 'strategize', 'deploy', 'brand', 'grow', 'target', 'syndicate', 'synthesize', 'deliver', 'mesh', 'incubate', 'engage', 'maximize', 'benchmark', 'expedite', 'reintermediate', 'whiteboard', 'visualize', 'repurpose', 'innovate', 'scale', 'unleash', 'drive', 'extend', 'engineer', 'revolutionize', 'generate', 'exploit', 'transition', 'e-enable', 'iterate', 'cultivate', 'matrix', 'productize', 'redefine', 'recontextualize'
|
||||
),
|
||||
array(
|
||||
'clicks-and-mortar', 'value-added', 'vertical', 'proactive', 'robust', 'revolutionary', 'scalable', 'leading-edge', 'innovative', 'intuitive', 'strategic', 'e-business', 'mission-critical', 'sticky', 'one-to-one', '24/7', 'end-to-end', 'global', 'B2B', 'B2C', 'granular', 'frictionless', 'virtual', 'viral', 'dynamic', '24/365', 'best-of-breed', 'killer', 'magnetic', 'bleeding-edge', 'web-enabled', 'interactive', 'dot-com', 'sexy', 'back-end', 'real-time', 'efficient', 'front-end', 'distributed', 'seamless', 'extensible', 'turn-key', 'world-class', 'open-source', 'cross-platform', 'cross-media', 'synergistic', 'bricks-and-clicks', 'out-of-the-box', 'enterprise', 'integrated', 'impactful', 'wireless', 'transparent', 'next-generation', 'cutting-edge', 'user-centric', 'visionary', 'customized', 'ubiquitous', 'plug-and-play', 'collaborative', 'compelling', 'holistic', 'rich'
|
||||
),
|
||||
array(
|
||||
'synergies', 'web-readiness', 'paradigms', 'markets', 'partnerships', 'infrastructures', 'platforms', 'initiatives', 'channels', 'eyeballs', 'communities', 'ROI', 'solutions', 'e-tailers', 'e-services', 'action-items', 'portals', 'niches', 'technologies', 'content', 'vortals', 'supply-chains', 'convergence', 'relationships', 'architectures', 'interfaces', 'e-markets', 'e-commerce', 'systems', 'bandwidth', 'infomediaries', 'models', 'mindshare', 'deliverables', 'users', 'schemas', 'networks', 'applications', 'metrics', 'e-business', 'functionalities', 'experiences', 'webservices', 'methodologies'
|
||||
)
|
||||
array()
|
||||
);
|
||||
protected static $catchPhraseWords = array(
|
||||
array('الخدمات','الحلول','الانظمة'),
|
||||
array('الذهبية','الذكية','المتطورة','المتقدمة', 'الدولية', 'المتخصصه', 'السريعة', 'المثلى', 'الابداعية', 'المتكاملة', 'المتغيرة', 'المثالية'),
|
||||
);
|
||||
|
||||
protected static $companySuffix = array('التجارية', 'وأولاده', 'للمساهمة المحدودة', 'للاستثمار', ' ذ.م.م', 'مساهمة عامة', 'وشركائه');
|
||||
protected static $companyPrefix = array('شركة','مؤسسة','مجموعة','مكتب','أكاديمية','معرض');
|
||||
protected static $companySuffix = array('وأولاده', 'للمساهمة المحدودة', ' ذ.م.م', 'مساهمة عامة', 'وشركائه');
|
||||
|
||||
public function companyPrefix()
|
||||
{
|
||||
return static::randomElement(self::$companyPrefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'Robust full-range hub'
|
||||
|
55
src/Faker/Provider/ar_JO/Internet.php
Normal file
55
src/Faker/Provider/ar_JO/Internet.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\ar_JO;
|
||||
|
||||
class Internet extends \Faker\Provider\Internet
|
||||
{
|
||||
protected static $userNameFormats = array(
|
||||
'{{lastNameAscii}}.{{firstNameAscii}}',
|
||||
'{{firstNameAscii}}.{{lastNameAscii}}',
|
||||
'{{firstNameAscii}}##',
|
||||
'?{{lastNameAscii}}',
|
||||
);
|
||||
protected static $safeEmailTld = array(
|
||||
'org', 'com', 'net', 'jo', 'me'
|
||||
);
|
||||
|
||||
protected static $tld = array(
|
||||
'com', 'com', 'com', 'biz', 'info', 'net', 'org', 'jo',
|
||||
);
|
||||
|
||||
protected static $lastNameAscii = array(
|
||||
'hamad', 'karam', 'abbas', 'abbad', 'kanaan', 'abulebbeh', 'abbadi', 'hasan', 'rashwani', 'nimry', 'qasem', 'obaisi'
|
||||
);
|
||||
protected static $firstNameAscii = array(
|
||||
'abd','omar','bilal','ahmad', 'mohammad', 'akram', 'fadi', 'mutaz', 'layth', 'osama', 'rami', 'sami', 'samer', 'bashar', 'abdullah', 'omar', 'amr', 'yazan', 'ibrahim', 'khaled', 'saleem'
|
||||
);
|
||||
|
||||
public static function lastNameAscii()
|
||||
{
|
||||
return static::randomElement(static::$lastNameAscii);
|
||||
}
|
||||
|
||||
public static function firstNameAscii()
|
||||
{
|
||||
return static::randomElement(static::$firstNameAscii);
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'ahmad.abbadi'
|
||||
*/
|
||||
public function userName()
|
||||
{
|
||||
$format = static::randomElement(static::$userNameFormats);
|
||||
|
||||
return static::bothify($this->generator->parse($format));
|
||||
}
|
||||
|
||||
/**
|
||||
* @example 'wewebit.jo'
|
||||
*/
|
||||
public function domainName()
|
||||
{
|
||||
return static::randomElement(static::$lastNameAscii) . '.' . $this->tld();
|
||||
}
|
||||
}
|
178
src/Faker/Provider/ar_JO/Lorem.php
Normal file
178
src/Faker/Provider/ar_JO/Lorem.php
Normal file
@ -0,0 +1,178 @@
|
||||
<?php
|
||||
|
||||
namespace Faker\Provider\ar_JO;
|
||||
|
||||
class Lorem extends \Faker\Provider\Lorem
|
||||
{
|
||||
protected static $wordList = array(
|
||||
'هناك', 'حقيقة', 'مثبتة', 'منذ', 'زمن', 'طويل', 'وهي', 'أن', 'المحتوى', 'المقروء', 'لصفحة', 'ما', 'سيلهي', 'القارئ', 'عن', 'التركيز', 'على', 'الشكل', 'الخارجي', 'للنص', 'أو', 'شكل', 'توضع', 'الفقرات', 'في', 'الصفحة', 'التي', 'يقرأها.', 'ولذلك', 'يتم', 'استخدام', 'طريقة', 'لوريم', 'إيبسوم', 'لأنها', 'تعطي', 'توزيعاَ', 'طبيعياَ', '-إلى', 'حد', 'ما-', 'للأحرف', 'عوضاً', '"هنا', 'يوجد', 'محتوى', 'نصي،', 'هنا', 'نصي"', 'فتجعلها', 'تبدو', '(أي', 'الأحرف)', 'وكأنها', 'نص', 'مقروء.', 'العديد', 'من', 'برامح', 'النشر', 'المكتبي', 'وبرامح', 'تحرير', 'صفحات', 'الويب', 'تستخدم', 'بشكل', 'إفتراضي', 'كنموذج', 'النص،', 'وإذا', 'قمت', 'بإدخال', 'أي', 'محرك', 'بحث', 'ستظهر', 'المواقع', 'الحديثة', 'العهد', 'نتائج', 'البحث.', 'مدى', 'السنين', 'ظهرت', 'نسخ', 'جديدة', 'ومختلفة', 'إيبسوم،', 'أحياناً', 'طريق', 'الصدفة،', 'وأحياناً', 'عمد', 'كإدخال', 'بعض', 'العبارات', 'الفكاهية', 'إليها.', 'إيبسوم', 'هو', 'ببساطة', 'شكلي', '(بمعنى', 'الغاية', 'هي', 'وليس', 'المحتوى)', 'ويُستخدم', 'صناعات', 'المطابع', 'ودور', 'النشر.', 'كان', 'ولايزال', 'المعيار', 'الشكلي', 'القرن', 'الخامس', 'عشر', 'عندما', 'قامت', 'مطبعة', 'مجهولة', 'برص', 'مجموعة', 'الأحرف', 'عشوائي', 'أخذتها', 'نص،', 'لتكوّن', 'كتيّب', 'بمثابة', 'دليل', 'مرجع', 'لهذه', 'الأحرف.', 'خمسة', 'قرون', 'الزمن', 'لم', 'تقضي', 'هذا', 'بل', 'انه', 'حتى', 'صار', 'مستخدماً', 'وبشكله', 'الأصلي', 'الطباعة', 'والتنضيد', 'الإلكتروني.', 'انتشر', 'كبير', 'ستينيّات', 'مع', 'إصدار', 'رقائق', 'ليتراسيت', 'البلاستيكية', 'تحوي', 'مقاطع', 'وعاد', 'لينتشر', 'مرة', 'أخرى', 'مؤخراَ', 'ظهور', 'برامج', 'الإلكتروني', 'مثل', '"ألدوس', 'بايج', 'مايكر', 'والتي', 'حوت', 'أيضاً', 'إيبسوم.', 'هنالك', 'الأنواع', 'المتوفرة', 'لنصوص', 'ولكن', 'الغالبية', 'تم', 'تعديلها', 'عبر', 'إدخال', 'النوادر', 'الكلمات', 'العشوائية', 'إلى', 'النص.', 'إن', 'كنت', 'تريد', 'ما،', 'عليك', 'تتحقق', 'أولاً', 'ليس', 'كلمات', 'عبارات', 'محرجة', 'غير', 'لائقة', 'مخبأة', 'بينما', 'تعمل', 'جميع', 'مولّدات', 'نصوص', 'الإنترنت', 'إعادة', 'تكرار', 'نفسه', 'عدة', 'مرات', 'بما', 'تتطلبه', 'الحاجة،', 'يقوم', 'مولّدنا', 'باستخدام', 'قاموس', 'يحوي', 'أكثر', 'كلمة', 'لا', 'تينية،', 'مضاف', 'إليها', 'الجمل', 'النموذجية،', 'لتكوين', 'ذو', 'منطقي', 'قريب', 'النص', 'الحقيقي.', 'وبالتالي', 'يكون', 'الناتح', 'خالي', 'التكرار،', 'شابه.', 'وهذا', 'يجعله', 'أول', 'مولّد', 'حقيقي', 'الإنترنت.', 'خلافاَ', 'للإعتقاد', 'السائد', 'فإن', 'نصاَ', 'عشوائياً،', 'له', 'جذور', 'الأدب', 'اللاتيني', 'الكلاسيكي', 'العام', 'قبل', 'الميلاد،', 'مما', 'عام', 'القدم.', 'قام', 'البروفيسور', '"ريتشارد', 'ماك', 'لينتوك', 'وهو', 'بروفيسور', 'اللغة', 'اللاتينية', 'جامعة', 'هامبدن-سيدني', 'فيرجينيا', 'بالبحث', 'أصول', 'لاتينية', 'غامضة', 'وخلال', 'تتبعه', 'الكلمة', 'اكتشف', 'المصدر', 'الغير', 'قابل', 'للشك.', 'فلقد', 'اتضح', 'تأتي', 'الأقسام', 'و', 'كتاب', '"حول', 'أقاصي', 'الخير', 'والشر"', 'للمفكر', 'شيشيرون', 'والذي', 'كتبه', 'الميلاد.', 'الكتاب', 'مقالة', 'علمية', 'مطولة', 'نظرية', 'الأخلاق،', 'وكان', 'شعبية', 'كبيرة', 'عصر', 'النهضة.', 'السطر', 'الأول', 'يأتي', 'سطر', 'القسم', 'الكتاب.', 'للمهتمين', 'قمنا', 'بوضع', 'إبسوم', 'القياسي', 'والمُستخدم', 'الأسفل.', 'وتم', 'توفير', 'لمؤلفه', 'بصيغها', 'الأصلية،', 'مرفقة', 'بالنسخ', 'الإنكليزية', 'لها', 'بترجمتها', 'هـ.راكهام'
|
||||
);
|
||||
|
||||
/**
|
||||
* @example 'Lorem'
|
||||
*/
|
||||
public static function word()
|
||||
{
|
||||
return static::randomElement(static::$wordList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an array of random words
|
||||
*
|
||||
* @example array('Lorem', 'ipsum', 'dolor')
|
||||
* @param integer $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 = array();
|
||||
for ($i=0; $i < $nb; $i++) {
|
||||
$words []= static::word();
|
||||
}
|
||||
|
||||
return $asText ? join(' ', $words) : $words;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random sentence
|
||||
*
|
||||
* @example 'Lorem ipsum dolor sit amet.'
|
||||
* @param integer $nbWords around how many words the sentence should contain
|
||||
* @param boolean $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 join($words, ' ') . '.';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an array of sentences
|
||||
*
|
||||
* @example array('Lorem ipsum dolor sit amet.', 'Consectetur adipisicing eli.')
|
||||
* @param integer $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 = array();
|
||||
for ($i=0; $i < $nb; $i++) {
|
||||
$sentences []= static::sentence();
|
||||
}
|
||||
|
||||
return $asText ? join(' ', $sentences) : $sentences;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a single paragraph
|
||||
*
|
||||
* @example 'Sapiente sunt omnis. Ut pariatur ad autem ducimus et. Voluptas rem voluptas sint modi dolorem amet.'
|
||||
* @param integer $nbSentences around how many sentences the paragraph should contain
|
||||
* @param boolean $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 join(static::sentences($nbSentences), ' ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an array of paragraphs
|
||||
*
|
||||
* @example array($paragraph1, $paragraph2, $paragraph3)
|
||||
* @param integer $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 = array();
|
||||
for ($i=0; $i < $nb; $i++) {
|
||||
$paragraphs []= static::paragraph();
|
||||
}
|
||||
|
||||
return $asText ? join("\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 integer $maxNbChars Maximum number of characters the text should contain (minimum 5)
|
||||
* @return string
|
||||
*/
|
||||
public static function text($maxNbChars = 200)
|
||||
{
|
||||
$text = array();
|
||||
if ($maxNbChars < 5) {
|
||||
throw new \InvalidArgumentException('text() can only generate text of at least 5 characters');
|
||||
} elseif ($maxNbChars < 25) {
|
||||
// join words
|
||||
while (empty($text)) {
|
||||
$size = 0;
|
||||
// determine how many words are needed to reach the $maxNbChars once;
|
||||
while ($size < $maxNbChars) {
|
||||
$word = ($size ? ' ' : '') . static::word();
|
||||
$text []= $word;
|
||||
$size += strlen($word);
|
||||
}
|
||||
array_pop($text);
|
||||
}
|
||||
$text[0][0] = static::toUpper($text[0][0]);
|
||||
$text[count($text) - 1] .= '.';
|
||||
} elseif ($maxNbChars < 100) {
|
||||
// join sentences
|
||||
while (empty($text)) {
|
||||
$size = 0;
|
||||
// determine how many sentences are needed to reach the $maxNbChars once;
|
||||
while ($size < $maxNbChars) {
|
||||
$sentence = ($size ? ' ' : '') . static::sentence();
|
||||
$text []= $sentence;
|
||||
$size += strlen($sentence);
|
||||
}
|
||||
array_pop($text);
|
||||
}
|
||||
} else {
|
||||
// join paragraphs
|
||||
while (empty($text)) {
|
||||
$size = 0;
|
||||
// determine how many paragraphs are needed to reach the $maxNbChars once;
|
||||
while ($size < $maxNbChars) {
|
||||
$paragraph = ($size ? "\n" : '') . static::paragraph();
|
||||
$text []= $paragraph;
|
||||
$size += strlen($paragraph);
|
||||
}
|
||||
array_pop($text);
|
||||
}
|
||||
}
|
||||
|
||||
return join($text, '');
|
||||
}
|
||||
|
||||
protected static function randomizeNbElements($nbElements)
|
||||
{
|
||||
return (int) ($nbElements * mt_rand(60, 140) / 100) + 1;
|
||||
}
|
||||
}
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user