@@ -3,21 +3,21 @@ discard block |
||
3 | 3 | return [ |
4 | 4 | |
5 | 5 | 'names' => [ |
6 | - 'عباس', 'وحید', 'علی', 'علیرضا', 'شاهرخ', 'سجاد', 'شایان' , 'حسام' , 'مهدی' , |
|
7 | - 'حسن' , 'حمید','شقایق', 'المیرا', 'شیما', 'مرجان', 'پرستو', 'نگار' , 'ترانه' , |
|
8 | - 'لیلا' , 'مریم' , 'سحر' , 'زهرا' , 'ریحانه' , 'منیر' , 'عطیه' , 'پروانه' , 'ترانه' |
|
6 | + 'عباس', 'وحید', 'علی', 'علیرضا', 'شاهرخ', 'سجاد', 'شایان', 'حسام', 'مهدی', |
|
7 | + 'حسن', 'حمید', 'شقایق', 'المیرا', 'شیما', 'مرجان', 'پرستو', 'نگار', 'ترانه', |
|
8 | + 'لیلا', 'مریم', 'سحر', 'زهرا', 'ریحانه', 'منیر', 'عطیه', 'پروانه', 'ترانه' |
|
9 | 9 | ], |
10 | 10 | |
11 | 11 | 'families' => [ |
12 | 12 | 'الماسی', 'جوشقانی', 'جمالیان', 'جعفری', 'فیض', 'نیاکان', 'بیات', |
13 | - 'پیرو' , 'حیدری' , 'نجاران' , 'اسد نژاد' , 'صمدی' , 'اسدی' , 'کریمی' , |
|
14 | - 'حسینی' , 'الماسی' , 'صدیقی' , 'مسقطی' , 'علی دوستی' , 'کریمزاده' , 'کوت آبادی' |
|
13 | + 'پیرو', 'حیدری', 'نجاران', 'اسد نژاد', 'صمدی', 'اسدی', 'کریمی', |
|
14 | + 'حسینی', 'الماسی', 'صدیقی', 'مسقطی', 'علی دوستی', 'کریمزاده', 'کوت آبادی' |
|
15 | 15 | ], |
16 | 16 | |
17 | 17 | 'companies' => [ |
18 | 18 | 'ای نتورک', 'خاورزمین', 'فرانش', 'کاروانرو', 'اسنپ', 'تپ سی', 'آواتک', |
19 | - 'بیدینگ' , 'سایت چک آپ' , 'شنبه' , 'دیجی کالا' , 'بامیلو' , 'ایرانسل' , |
|
20 | - 'همراه اول' , 'سرآوا پارس' , 'ایران خودرو' , 'سایپا' , 'تاژ' , 'هومکر' , 'کاموا' , |
|
19 | + 'بیدینگ', 'سایت چک آپ', 'شنبه', 'دیجی کالا', 'بامیلو', 'ایرانسل', |
|
20 | + 'همراه اول', 'سرآوا پارس', 'ایران خودرو', 'سایپا', 'تاژ', 'هومکر', 'کاموا', |
|
21 | 21 | 'کانگرو' |
22 | 22 | ], |
23 | 23 | |
@@ -41,23 +41,23 @@ discard block |
||
41 | 41 | ], |
42 | 42 | |
43 | 43 | 'mailServices' => [ |
44 | - 'gmail.com' , 'mail.com' , 'yahoo.com' , 'outlook.com' |
|
44 | + 'gmail.com', 'mail.com', 'yahoo.com', 'outlook.com' |
|
45 | 45 | ], |
46 | 46 | |
47 | 47 | 'prefixTelePhones' => [ |
48 | - 912 , 931 , 932 , 933 , 901 , 921 , 919 , 912 , 913 , 917 , |
|
49 | - 915 , 916 , 910 , 939 , 938 , 937 , 918 , 914 , 911 , 934 |
|
48 | + 912, 931, 932, 933, 901, 921, 919, 912, 913, 917, |
|
49 | + 915, 916, 910, 939, 938, 937, 918, 914, 911, 934 |
|
50 | 50 | ], |
51 | 51 | |
52 | 52 | 'prefixPhones' => [ |
53 | - 21 , 25 , 253 , 32 , 45 , 67 , 11 , 12 , 93 , 65 , 34 , 67 |
|
53 | + 21, 25, 253, 32, 45, 67, 11, 12, 93, 65, 34, 67 |
|
54 | 54 | ], |
55 | 55 | |
56 | - 'protocols' => [ 'http' , 'https' ], |
|
56 | + 'protocols' => ['http', 'https'], |
|
57 | 57 | |
58 | 58 | |
59 | 59 | 'domains' => [ |
60 | - '.com' , '.org' , '.ir' , '.net' , '.me' , '.info' , '.co' |
|
60 | + '.com', '.org', '.ir', '.net', '.me', '.info', '.co' |
|
61 | 61 | ], |
62 | 62 | |
63 | 63 | 'city' => [ |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace Josh\Faker; |
4 | 4 | |
5 | -if(! function_exists('string')){ |
|
5 | +if (!function_exists('string')) { |
|
6 | 6 | /** |
7 | 7 | * Return string of variable |
8 | 8 | * |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | } |
18 | 18 | } |
19 | 19 | |
20 | -if(! function_exists('faker')){ |
|
20 | +if (!function_exists('faker')) { |
|
21 | 21 | /** |
22 | 22 | * Return the faker instance |
23 | 23 | * |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | } |
32 | 32 | } |
33 | 33 | |
34 | -if(! function_exists('randomNumber')){ |
|
34 | +if (!function_exists('randomNumber')) { |
|
35 | 35 | /** |
36 | 36 | * Return random number |
37 | 37 | * |
@@ -47,16 +47,16 @@ discard block |
||
47 | 47 | |
48 | 48 | $number = ''; |
49 | 49 | |
50 | - for($i = 1;$i <= $length;$i++){ |
|
51 | - $num = $numbers[rand(0,strlen($numbers) - 1)]; |
|
52 | - if($num === 0 && $i === 1){ |
|
50 | + for ($i = 1; $i <= $length; $i++) { |
|
51 | + $num = $numbers[rand(0, strlen($numbers) - 1)]; |
|
52 | + if ($num === 0 && $i === 1) { |
|
53 | 53 | continue; |
54 | 54 | } |
55 | 55 | |
56 | - $number .= $num ; |
|
56 | + $number .= $num; |
|
57 | 57 | } |
58 | 58 | |
59 | - if($int){ |
|
59 | + if ($int) { |
|
60 | 60 | return (integer)$number; |
61 | 61 | } |
62 | 62 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
67 | -if(! function_exists('randomString')){ |
|
67 | +if (!function_exists('randomString')) { |
|
68 | 68 | |
69 | 69 | /** |
70 | 70 | * Get random string |
@@ -75,17 +75,17 @@ discard block |
||
75 | 75 | * @param null $type |
76 | 76 | * @return string |
77 | 77 | */ |
78 | - function randomString($length = 20, $type = null){ |
|
78 | + function randomString($length = 20, $type = null) { |
|
79 | 79 | |
80 | 80 | $uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; |
81 | 81 | |
82 | 82 | $lowercase = 'abcdefghijklmnopqrstuvwxyz'; |
83 | 83 | |
84 | - if(is_null($type)){ |
|
84 | + if (is_null($type)) { |
|
85 | 85 | |
86 | 86 | $characters = $uppercase . $lowercase; |
87 | 87 | |
88 | - } elseif ($type = 'lowercase'){ |
|
88 | + } elseif ($type = 'lowercase') { |
|
89 | 89 | |
90 | 90 | $characters = $lowercase; |
91 | 91 | |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | $characters = $uppercase; |
94 | 94 | } |
95 | 95 | |
96 | - $string = ''; |
|
96 | + $string = ''; |
|
97 | 97 | |
98 | - for($i = 1;$i <= $length;$i++){ |
|
99 | - $string .= $characters[rand(0,strlen($characters) - 1)]; |
|
98 | + for ($i = 1; $i <= $length; $i++) { |
|
99 | + $string .= $characters[rand(0, strlen($characters) - 1)]; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return $string; |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | |
105 | 105 | } |
106 | 106 | |
107 | -if(! function_exists('isMeliCode')){ |
|
107 | +if (!function_exists('isMeliCode')) { |
|
108 | 108 | /** |
109 | 109 | * Check is meli code function |
110 | 110 | * |
@@ -123,12 +123,12 @@ discard block |
||
123 | 123 | $value = '0' . $value; |
124 | 124 | } |
125 | 125 | for ($i = 0; $i <= 8; $i++) { |
126 | - $sub = $sub + ( $value[$i] * ( 10 - $i ) ); |
|
126 | + $sub = $sub + ($value[$i] * (10 - $i)); |
|
127 | 127 | } |
128 | - if (( $sub % 11 ) < 2) { |
|
129 | - $control = ( $sub % 11 ); |
|
128 | + if (($sub % 11) < 2) { |
|
129 | + $control = ($sub % 11); |
|
130 | 130 | } else { |
131 | - $control = 11 - ( $sub % 11 ); |
|
131 | + $control = 11 - ($sub % 11); |
|
132 | 132 | } |
133 | 133 | if ($value[9] == $control) { |
134 | 134 | return true; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | |
124 | 124 | $service = $this->objects['mailServices'][$service]; |
125 | 125 | |
126 | - return string(randomString(30,'lowercase') . '@' . $service); |
|
126 | + return string(randomString(30, 'lowercase') . '@' . $service); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $domain = $this->objects['domains'][$domain]; |
141 | 141 | |
142 | - return string(randomString(20,'lowercase') . $domain); |
|
142 | + return string(randomString(20, 'lowercase') . $domain); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -167,17 +167,17 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function pageUrl() |
169 | 169 | { |
170 | - $rand = rand(3,7); |
|
170 | + $rand = rand(3, 7); |
|
171 | 171 | |
172 | 172 | $string = ''; |
173 | 173 | |
174 | - $count = rand(2,8); |
|
174 | + $count = rand(2, 8); |
|
175 | 175 | |
176 | - for($i=0;$i < $rand;$i++){ |
|
177 | - $string .= randomString($count,'lowercase') . '/'; |
|
176 | + for ($i = 0; $i < $rand; $i++) { |
|
177 | + $string .= randomString($count, 'lowercase') . '/'; |
|
178 | 178 | } |
179 | 179 | |
180 | - return rtrim($string,'/'); |
|
180 | + return rtrim($string, '/'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function age($min = 16, $max = 70) |
193 | 193 | { |
194 | - return rand($min,$max); |
|
194 | + return rand($min, $max); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -232,33 +232,33 @@ discard block |
||
232 | 232 | public function meliCode() |
233 | 233 | { |
234 | 234 | $i = 0; |
235 | - $code= null; |
|
235 | + $code = null; |
|
236 | 236 | |
237 | - while($i <= 100){ |
|
237 | + while ($i <= 100) { |
|
238 | 238 | |
239 | - $meli = randomNumber(10,true); |
|
239 | + $meli = randomNumber(10, true); |
|
240 | 240 | |
241 | - if(strlen($meli) != 10){ |
|
241 | + if (strlen($meli) != 10) { |
|
242 | 242 | continue; |
243 | 243 | } |
244 | 244 | |
245 | - $c = substr($meli,9,1); |
|
245 | + $c = substr($meli, 9, 1); |
|
246 | 246 | |
247 | - $n = substr($meli,0,1) * 10 + |
|
248 | - substr($meli,1,1) * 9 + |
|
249 | - substr($meli,2,1) * 8 + |
|
250 | - substr($meli,3,1) * 7 + |
|
251 | - substr($meli,4,1) * 6 + |
|
252 | - substr($meli,5,1) * 5 + |
|
253 | - substr($meli,6,1) * 4 + |
|
254 | - substr($meli,7,1) * 3 + |
|
255 | - substr($meli,8,1) * 2; |
|
247 | + $n = substr($meli, 0, 1) * 10 + |
|
248 | + substr($meli, 1, 1) * 9 + |
|
249 | + substr($meli, 2, 1) * 8 + |
|
250 | + substr($meli, 3, 1) * 7 + |
|
251 | + substr($meli, 4, 1) * 6 + |
|
252 | + substr($meli, 5, 1) * 5 + |
|
253 | + substr($meli, 6, 1) * 4 + |
|
254 | + substr($meli, 7, 1) * 3 + |
|
255 | + substr($meli, 8, 1) * 2; |
|
256 | 256 | |
257 | 257 | $r = $n - (int)($n / 11) * 11; |
258 | 258 | |
259 | 259 | if (($r == 0 && $r == $c) || ($r == 1 && $c == 1) || ($r > 1 && $c == 11 - $r)) { |
260 | 260 | |
261 | - if(! isMeliCode($meli)){ |
|
261 | + if (!isMeliCode($meli)) { |
|
262 | 262 | continue; |
263 | 263 | } |
264 | 264 |