CacheDecoratorFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A createWebService() 0 7 1
1
<?php
2
3
namespace SkautisBundle\Skautis\Wsdl;
4
5
use Skautis\Wsdl\WebServiceFactoryInterface;
6
use Skautis\Wsdl\Decorator\Cache\CacheInterface;
7
use Skautis\Wsdl\Decorator\Cache\CacheDecorator;
8
9
/**
10
 * Trida pro pridavani cache decoratur na web service
11
 */
12
class CacheDecoratorFactory implements WebServiceFactoryInterface
13
{
14
    /**
15
     * @var WebServiceFactoryInterface
16
     */
17
    protected $webServiceFactory;
18
19
    /**
20
     * @var CacheInterface
21
     */
22
    protected $cache;
23
24
    public function __construct(WebServiceFactoryInterface $webServiceFactory, CacheInterface $cache)
25
    {
26
        $this->webServiceFactory = $webServiceFactory;
27
        $this->cache = $cache;
28
    }
29
30
    public function createWebService($url, array $options)
31
    {
32
        $webService = $this->webServiceFactory->createWebService($url, $options);
33
        $webService = new CacheDecorator($webService, $this->cache);
34
35
        return $webService;
36
    }
37
}
38