Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Faker\Provider\fi_FI;
4
 
5
class PhoneNumber extends \Faker\Provider\PhoneNumber
6
{
7
    /**
8
     * @see https://www.viestintavirasto.fi/en/internettelephone/numberingoftelecommunicationsnetworks/localcallsandtelecommunicationsareas/mapoftelecommunicationsareas.html
9
     *
10
     * @var array
11
     */
12
    protected static $landLineareaCodes = [
13
        '02',
14
        '03',
15
        '05',
16
        '06',
17
        '08',
18
        '09',
19
        '013',
20
        '014',
21
        '015',
22
        '016',
23
        '017',
24
        '018',
25
        '019',
26
    ];
27
 
28
    /**
29
     * @see https://www.viestintavirasto.fi/en/internettelephone/numberingoftelecommunicationsnetworks/mobilenetworks/mobilenetworkareacodes.html
30
     *
31
     * @var array
32
     */
33
    protected static $mobileNetworkAreaCodes = [
34
        '040',
35
        '050',
36
        '044',
37
        '045',
38
    ];
39
 
40
    protected static $numberFormats = [
41
        '### ####',
42
        '#######',
43
    ];
44
 
45
    protected static $formats = [
46
        '+358 ({{ e164MobileNetworkAreaCode }}) {{ numberFormat }}',
47
        '+358 {{ e164MobileNetworkAreaCode }} {{ numberFormat }}',
48
        '+358 ({{ e164landLineAreaCode }}) {{ numberFormat }}',
49
        '+358 {{ e164landLineAreaCode }} {{ numberFormat }}',
50
        '{{ mobileNetworkAreaCode }}{{ separator }}{{ numberFormat }}',
51
        '{{ landLineAreaCode }}{{ separator }}{{ numberFormat }}',
52
    ];
53
 
54
    /**
55
     * @return string
56
     */
57
    public function landLineAreaCode()
58
    {
59
        return static::randomElement(static::$landLineareaCodes);
60
    }
61
 
62
    /**
63
     * @return string
64
     */
65
    public function e164landLineAreaCode()
66
    {
67
        return substr(static::randomElement(static::$landLineareaCodes), 1);
68
    }
69
 
70
    /**
71
     * @return string
72
     */
73
    public function mobileNetworkAreaCode()
74
    {
75
        return static::randomElement(static::$mobileNetworkAreaCodes);
76
    }
77
 
78
    /**
79
     * @return string
80
     */
81
    public function e164MobileNetworkAreaCode()
82
    {
83
        return substr(static::randomElement(static::$mobileNetworkAreaCodes), 1);
84
    }
85
 
86
    /**
87
     * @return string
88
     */
89
    public function numberFormat()
90
    {
91
        return static::randomElement(static::$numberFormats);
92
    }
93
 
94
    /**
95
     * @return string
96
     */
97
    public function separator()
98
    {
99
        return static::randomElement([' ', '-']);
100
    }
101
}