Faker/Plugin/TelephoneNumber.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod n/a totaltotal 0.0% 0 / 37 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Faker::Plugin::TelephoneNumber;
2  
3 use 5.014;
4  
5 use strict;
6 use warnings;
7  
8 use registry;
9 use routines;
10  
11 use Data::Object::Class;
12 use Data::Object::ClassHas;
13  
14 extends 'Data::Object::Plugin';
15  
16 our $VERSION = '1.03'; # VERSION
17  
18 # ATTRIBUTES
19  
20 has 'faker' => (
21 is => 'ro',
22 isa => 'ConsumerOf["Faker::Maker"]',
23 req => 1,
24 );
25  
26 # METHODS
27  
28 method execute() {
29 my $faker = $self->faker;
30  
31 my $options = {
32 all_markers => 1
33 };
34  
35 return $faker->process(['telephone', 'number'], $options);
36 }
37  
38 1;
39  
40 =encoding utf8
41  
42 =head1 NAME
43  
44 Faker::Plugin::TelephoneNumber
45  
46 =cut
47  
48 =head1 ABSTRACT
49  
50 Telephone Number Plugin for Faker
51  
52 =cut
53  
54 =head1 SYNOPSIS
55  
56 package main;
57  
58 use Faker;
59 use Faker::Plugin::TelephoneNumber;
60  
61 my $f = Faker->new;
62 my $p = Faker::Plugin::TelephoneNumber->new(faker => $f);
63  
64 my $plugin = $p;
65  
66 =cut
67  
68 =head1 DESCRIPTION
69  
70 This package provides methods for generating fake telephone number data.
71  
72 =cut
73  
74 =head1 INHERITS
75  
76 This package inherits behaviors from:
77  
78 L<Data::Object::Plugin>
79  
80 =cut
81  
82 =head1 LIBRARIES
83  
84 This package uses type constraints from:
85  
86 L<Types::Standard>
87  
88 =cut
89  
90 =head1 ATTRIBUTES
91  
92 This package has the following attributes:
93  
94 =cut
95  
96 =head2 faker
97  
98 faker(ConsumerOf["Faker::Maker"])
99  
100 This attribute is read-only, accepts C<(ConsumerOf["Faker::Maker"])> values, and is required.
101  
102 =cut
103  
104 =head1 METHODS
105  
106 This package implements the following methods:
107  
108 =cut
109  
110 =head2 execute
111  
112 execute() : Str
113  
114 The execute method returns a random fake telephone number.
115  
116 =over 4
117  
118 =item execute example #1
119  
120 # given: synopsis
121  
122 $p->execute;
123  
124 =back
125  
126 =cut
127  
128 =head1 AUTHOR
129  
130 Al Newkirk, C<awncorp@cpan.org>
131  
132 =head1 LICENSE
133  
134 Copyright (C) 2011-2019, Al Newkirk, et al.
135  
136 This is free software; you can redistribute it and/or modify it under the terms
137 of the The Apache License, Version 2.0, as elucidated in the L<"license
138 file"|https://github.com/iamalnewkirk/faker/blob/master/LICENSE>.
139  
140 =head1 ACKNOWLEDGEMENTS
141  
142 Parts of this library were inspired by the following implementations:
143  
144 L<PHP Faker|https://github.com/fzaninotto/Faker>
145  
146 L<Ruby Faker|https://github.com/stympy/faker>
147  
148 L<Python Faker|https://github.com/joke2k/faker>
149  
150 L<JS Faker|https://github.com/Marak/faker.js>
151  
152 L<Elixir Faker|https://github.com/elixirs/faker>
153  
154 =head1 PROJECT
155  
156 L<Wiki|https://github.com/iamalnewkirk/faker/wiki>
157  
158 L<Project|https://github.com/iamalnewkirk/faker>
159  
160 L<Initiatives|https://github.com/iamalnewkirk/faker/projects>
161  
162 L<Milestones|https://github.com/iamalnewkirk/faker/milestones>
163  
164 L<Contributing|https://github.com/iamalnewkirk/faker/blob/master/CONTRIBUTE.md>
165  
166 L<Issues|https://github.com/iamalnewkirk/faker/issues>
167  
168 =cut