Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Added Company generator for ru_RU locale #371

Merged
merged 2 commits into from
Oct 29, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions src/Faker/Provider/ru_RU/Company.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

namespace Faker\Provider\ru_RU;

class Company extends \Faker\Provider\Company
{
protected static $companyNameFormats = array(
'{{companyPrefix}} {{companyNameElement}}',
'{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}',
'{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}{{companyNameElement}}',
'{{companyPrefix}} {{companyNameElement}}{{companyNameElement}}{{companyNameElement}}{{companyNameSuffix}}',
);

protected static $companyPrefixes = array(
'ООО', 'ЗАО', 'ООО Компания', 'ОАО', 'ОАО'
);

protected static $companyNameSuffixes = array(
'Маш', 'Наладка', 'Экспедиция', 'Пром', 'Комплекс', 'Машина', 'Снос', '-М', 'Лизинг', 'Траст'
);

protected static $companyElements = array(
'ЖелДор', 'Гараж', 'Цемент', 'Асбоцемент', 'Строй', 'Лифт', 'Креп', 'Авто', 'Теле', 'Транс', 'Алмаз', 'Метиз',
'Мотор', 'Рос', 'Тяж', 'Тех', 'Сантех', 'Урал', 'Башкир', 'Тверь', 'Казань', 'Обл', 'Бух', 'Хоз', 'Электро',
'Текстиль'
);

/**
* @example 'ООО АсбестЦементМонтаж'
*/
public function company()
{
$format = static::randomElement(static::$companyNameFormats);

return $this->generator->parse($format);
}

public static function companyPrefix()
{
return static::randomElement(static::$companyPrefixes);
}

public static function companyNameElement()
{
return static::randomElement(static::$companyElements);
}

public static function companyNameSuffix()
{
return static::randomElement(static::$companyNameSuffixes);
}
}