LottoClientFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
namespace Dwr\LottoClientBundle\Factory;
4
5
use Dwr\LottoClientBundle\Service\LottoClient;
6
use SoapClient;
7
8
class LottoClientFactory
9
{
10
    /**
11
     * @var string
12
     */
13
    private $wsdl;
14
15
    /**
16
     * @param string $wsdl
17
     */
18
    public function __construct($wsdl)
19
    {
20
        $this->wsdl = $wsdl;
21
    }
22
23
    /**
24
     * @return LottoClient
25
     */
26
    public function createLottoClient()
27
    {
28
        $client = new SoapClient(
29
            $this->wsdl,
30
            array(
31
                'trace'     => true,
32
                'exception' => false
33
            )
34
        );
35
        return new LottoClient($client);
36
    }
37
}
38