GlobalWeatherClient   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 0
dl 0
loc 33
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A connect() 0 7 1
1
<?php
2
namespace Dwr\GlobalWeatherBundle\WeatherService\Client;
3
4
class GlobalWeatherClient
5
{
6
    /**
7
     * @var string
8
     */
9
    private $wsdl;
10
11
    /**
12
     * @var integer
13
     */
14
    private $timeout;
15
16
    /**
17
     * @param array $configuration
18
     */
19
    public function __construct(array $configuration)
20
    {
21
        $this->wsdl    = $configuration['wsdl'];
22
        $this->timeout = $configuration['timeout'];
23
    }
24
25
    /**
26
     * @return \SoapClient
27
     * @throws \Exception
28
     */
29
    public function connect()
30
    {
31
        ini_set('default_socket_timeout', $this->timeout);
32
        $soapClient = new \SoapClient($this->wsdl, array('exceptions'=> true));
33
34
        return $soapClient;
35
    }
36
}
37