Phone.pm

filter: Statementstmt 62.5% 10 / 16 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 100% 2 / 2 totaltotal 60.0% 15 / 25 CC 2 SCAR 10.4
CC
2
Cov
56%
PhoneValidator
6.0
PhoneFinder
2.0
BEGIN
1.0
CRAP 2.8
« Finder.pm ↑ Summary Keys.pm »
1 package Tomba::Phone;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use parent 'Tomba::Client';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Tomba::Phone - Phone finder and validator for the Tomba.io API
10  
11 =head1 SYNOPSIS
12  
13 use Tomba::Phone;
14  
15 my $tomba = Tomba::Phone->new("ta_xxxxx", "ts_xxxxx");
16 my $phone = $tomba->PhoneFinder({ email => 'm@wordpress.org' });
17 my $valid = $tomba->PhoneValidator("+14155552671", "US");
18  
19 =head1 DESCRIPTION
20  
21 Find and validate phone numbers via the Tomba API.
22  
23 =cut
24  
25 #-------------------------------------------------------------------------------
26 # Phone Finder
27 #-------------------------------------------------------------------------------
28  
29 =head2 PhoneFinder
30  
31 my $data = $tomba->PhoneFinder({ email => 'm@wordpress.org' });
32 my $data = $tomba->PhoneFinder({ domain => 'tomba.io' });
33 my $data = $tomba->PhoneFinder({ linkedin => 'https://www.linkedin.com/in/alex-maccaw-ab592978' });
34  
35 Search for phone numbers based on an email, domain, or LinkedIn URL.
36  
37 See L<https://docs.tomba.io/api/phone#get-phone-finder>
38  
39 =cut
40  
41 0 ▶sub PhoneFinder {
Subroutine PhoneFinder: not called CC=1 SCAR=6.9
Pod documented
42 0 my ($self, $params) = @_;
43 0 return $self->call(Tomba::Client::PHONE_FINDER_PATH, $params);
44 }
45  
46 #-------------------------------------------------------------------------------
47 # Phone Validator
48 #-------------------------------------------------------------------------------
49  
50 =head2 PhoneValidator
51  
52 my $data = $tomba->PhoneValidator("+14155552671", "US");
53  
54 Validate a phone number and retrieve its associated information.
55  
56 See L<https://docs.tomba.io/api/phone#get-phone-validator>
57  
58 =cut
59  
60 0 ▶sub PhoneValidator {
Subroutine PhoneValidator: not called CC=2 SCAR=17.9
Pod documented
61 0 my ($self, $phone, $country_code) = @_;
62 0 my $params = {
63 phone => $phone,
64 };
65 0 ▶ $params->{country_code} = $country_code if $country_code;
Branch: 1 branch
BranchTrueFalseTotal
if $country_code 0 0 0
66 0 return $self->call(Tomba::Client::PHONE_VALIDATOR_PATH, $params);
67 }
68  
69 4 1;
70 __END__
« Finder.pm ↑ Summary Keys.pm »