GlobalWeatherClient::connect()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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