Faker/Plugin/EnUs/TelephoneNumber.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 50.0% 1 / 2 totaltotal 96.0% 24 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Faker/Plugin/EnUs/PersonName.pm ↑ Summary Faker/Plugin/EsEs/AddressCityName.pm »
1 package Faker::Plugin::EnUs::TelephoneNumber;
2  
3 2 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Venus::Class 'base';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 base 'Faker::Plugin::EnUs';
11  
12 # VERSION
13  
14 2 our $VERSION = '1.19';
15  
16 # METHODS
17  
18 6 ▶sub execute {
Subroutine execute: called CC=1 SCAR=0.0
Pod documented
19 6 my ($self, $data) = @_;
20  
21 6 return $self->process_markers(
22 $self->faker->random->select(format_for_telephone_number()),
23 'numbers',
24 );
25 }
26  
27 6 ▶sub format_for_telephone_number {
Subroutine format_for_telephone_number: called CC=1 SCAR=0.0
Pod undocumented
28 6 state $telephone_number = [
29 '###-###-####',
30 '###-###-####',
31 '### ### ####',
32 '### ### ####',
33 '### ### ####',
34 '### ### ####',
35 '(###) ###-####',
36 '(###) ###-####',
37 '(###) ###-####',
38 '(###) ###-####',
39 '+##(#)##########',
40 '+##(#)##########',
41 '0##########',
42 '0##########',
43 '###-###-####',
44 '(###) ### ####',
45 '1-###-###-####',
46 '###.###.####',
47 '###-###-####',
48 '### ### ####',
49 '##########',
50 '(###) ###-####',
51 '1-###-###-####',
52 '###.###.####',
53 '###-###-####x###',
54 '(###)###-####x###',
55 '1-###-###-####x###',
56 '###.###.####x###',
57 '###-###-#### x####',
58 '(###)###-####x####',
59 '1-###-###-####x####',
60 '###.###.####x####',
61 '###-###-####x#####',
62 '(###)###-####x#####',
63 '1-###-###-####x#####',
64 '###.###.#### x#####',
65 ]
66 }
67  
68 2 1;
69  
70  
71  
72 =head1 NAME
73  
74 Faker::Plugin::EnUs::TelephoneNumber - Telephone Number
75  
76 =cut
77  
78 =head1 ABSTRACT
79  
80 Telephone Number for Faker
81  
82 =cut
83  
84 =head1 VERSION
85  
86 1.19
87  
88 =cut
89  
90 =head1 SYNOPSIS
91  
92 package main;
93  
94 use Faker::Plugin::EnUs::TelephoneNumber;
95  
96 my $plugin = Faker::Plugin::EnUs::TelephoneNumber->new;
97  
98 # bless(..., "Faker::Plugin::EnUs::TelephoneNumber")
99  
100 =cut
101  
102 =head1 DESCRIPTION
103  
104 This package provides methods for generating fake data for telephone number.
105  
106 =encoding utf8
107  
108 =cut
109  
110 =head1 INHERITS
111  
112 This package inherits behaviors from:
113  
114 L<Faker::Plugin::EnUs>
115  
116 =cut
117  
118 =head1 METHODS
119  
120 This package provides the following methods:
121  
122 =cut
123  
124 =head2 execute
125  
126 execute(HashRef $data) (Str)
127  
128 The execute method returns a returns a random fake telephone number.
129  
130 I<Since C<1.10>>
131  
132 =over 4
133  
134 =item execute example 1
135  
136 package main;
137  
138 use Faker::Plugin::EnUs::TelephoneNumber;
139  
140 my $plugin = Faker::Plugin::EnUs::TelephoneNumber->new;
141  
142 # bless(..., "Faker::Plugin::EnUs::TelephoneNumber")
143  
144 # my $result = $plugin->execute;
145  
146 # "01408446845";
147  
148 # my $result = $plugin->execute;
149  
150 # "769-454-4390";
151  
152 # my $result = $plugin->execute;
153  
154 # "1-822-037-0225x82882";
155  
156 =back
157  
158 =cut
159  
160 =head2 new
161  
162 new(HashRef $data) (Plugin)
163  
164 The new method returns a new instance of the class.
165  
166 I<Since C<1.10>>
167  
168 =over 4
169  
170 =item new example 1
171  
172 package main;
173  
174 use Faker::Plugin::EnUs::TelephoneNumber;
175  
176 my $plugin = Faker::Plugin::EnUs::TelephoneNumber->new;
177  
178 # bless(..., "Faker::Plugin::EnUs::TelephoneNumber")
179  
180 =back
181  
182 =cut
183  
184 =head1 AUTHORS
185  
186 Awncorp, C<awncorp@cpan.org>
187  
188 =cut
189  
190 =head1 LICENSE
191  
192 Copyright (C) 2000, Al Newkirk.
193  
194 This program is free software, you can redistribute it and/or modify it under
195 the terms of the Apache license version 2.0.
196  
197 =cut
« Faker/Plugin/EnUs/PersonName.pm ↑ Summary Faker/Plugin/EsEs/AddressCityName.pm »