LottoClientFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createLottoClient() 0 11 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