PluginProbe ʕ •ᴥ•ʔ
Kubio AI Page Builder / 2.8.6
Kubio AI Page Builder v2.8.6
2.9.0 2.8.6 2.8.5 2.8.4 2.8.3 2.8.2 2.8.1 trunk 1.0.0 1.0.1 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.3.0 1.3.1 1.3.2 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.9.0 2.0.0 2.1.1 2.1.2 2.1.3 2.2.0 2.2.3 2.2.4 2.2.5 2.3.0 2.3.1 2.3.3 2.3.4 2.4.0 2.4.1 2.4.2 2.4.3 2.4.5 2.5.0 2.5.1 2.5.2 2.5.3 2.6.0 2.6.1 2.6.2 2.6.3 2.6.5 2.6.6 2.6.7 2.7.0 2.7.1 2.7.2 2.7.3 2.8.0
kubio / vendor / fzaninotto / faker / src / Faker / Provider / pl_PL / Company.php
kubio / vendor / fzaninotto / faker / src / Faker / Provider / pl_PL Last commit date
Address.php 1 year ago Company.php 1 year ago Internet.php 1 year ago Payment.php 1 year ago Person.php 1 year ago PhoneNumber.php 1 year ago Text.php 1 year ago
Company.php
81 lines
1 <?php
2
3 namespace Faker\Provider\pl_PL;
4
5 class Company extends \Faker\Provider\Company
6 {
7 protected static $formats = array(
8 '{{lastName}}',
9 '{{lastName}}',
10 '{{lastName}} {{companySuffix}}',
11 '{{lastName}} {{companySuffix}}',
12 '{{lastName}} {{companySuffix}}',
13 '{{lastName}} {{companySuffix}}',
14 '{{companyPrefix}} {{lastName}}',
15 '{{lastName}}-{{lastName}}',
16 );
17
18 protected static $companySuffix = array('S.A.', 'i syn', 'sp. z o.o.', 'sp. j.', 'sp. p.', 'sp. k.', 'S.K.A', 's. c.', 'P.P.O.F');
19
20 protected static $companyPrefix = array('Grupa', 'Fundacja', 'Stowarzyszenie', 'Spółdzielnia');
21
22 /**
23 * @example 'Grupa'
24 */
25 public static function companyPrefix()
26 {
27 return static::randomElement(static::$companyPrefix);
28 }
29
30 /*
31 * Register of the National Economy
32 * @link http://pl.wikipedia.org/wiki/REGON
33 * @return 9 digit number
34 */
35 public static function regon()
36 {
37 $weights = array(8, 9, 2, 3, 4, 5, 6, 7);
38 $regionNumber = static::numberBetween(0, 49) * 2 + 1;
39 $result = array((int) ($regionNumber / 10), $regionNumber % 10);
40 for ($i = 2, $size = count($weights); $i < $size; $i++) {
41 $result[$i] = static::randomDigit();
42 }
43 $checksum = 0;
44 for ($i = 0, $size = count($result); $i < $size; $i++) {
45 $checksum += $weights[$i] * $result[$i];
46 }
47 $checksum %= 11;
48 if ($checksum == 10) {
49 $checksum = 0;
50 }
51 $result[] = $checksum;
52
53 return implode('', $result);
54 }
55
56 /**
57 * Register of the National Economy, local entity number
58 * @link http://pl.wikipedia.org/wiki/REGON
59 * @return 14 digit number
60 */
61 public static function regonLocal()
62 {
63 $weights = array(2, 4, 8, 5, 0, 9, 7, 3, 6, 1, 2, 4, 8);
64 $result = str_split(static::regon());
65 for ($i = count($result), $size = count($weights); $i < $size; $i++) {
66 $result[$i] = static::randomDigit();
67 }
68 $checksum = 0;
69 for ($i = 0, $size = count($result); $i < $size; $i++) {
70 $checksum += $weights[$i] * $result[$i];
71 }
72 $checksum %= 11;
73 if ($checksum == 10) {
74 $checksum = 0;
75 }
76 $result[] = $checksum;
77
78 return implode('', $result);
79 }
80 }
81