Nexmo   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 29
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A configureOptions() 0 13 1
1
<?php
2
3
namespace DoS\SMSBundle\SMS\Provider;
4
5
use DoS\SMSBundle\SMS\ProviderInterface;
6
use SmsSender\HttpAdapter\HttpAdapterInterface;
7
use SmsSender\Provider\NexmoProvider;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
10
class Nexmo extends NexmoProvider implements ProviderInterface
11
{
12
    use ProviderTrait;
13
14
    public function __construct(HttpAdapterInterface $adapter, $api_key, $api_secret, $international_prefix = '+66')
15
    {
16
        $this->validateOptions(array(
17
            'api_key' => $api_key,
18
            'api_secret' => $api_secret,
19
            'international_prefix' => $international_prefix,
20
        ));
21
22
        parent::__construct($adapter, $api_key, $api_secret, $international_prefix);
23
    }
24
25
    public function configureOptions(OptionsResolver $resolver)
26
    {
27
        $resolver->setDefaults(array(
28
            'api_key' => null,
29
            'api_secret' => null,
30
            'international_prefix' => '+66',
31
        ));
32
33
        $resolver->setRequired(array(
34
            'api_key',
35
            'api_secret',
36
        ));
37
    }
38
}
39