Completed
Push — 7.0 ( 66fc99...d11e6e )
by André
14:26
created

UpdateUrlSlot   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A receive() 0 6 2
1
<?php
2
3
/**
4
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
5
 * @license For full copyright and license information view LICENSE file distributed with this source code.
6
 */
7
namespace eZ\Publish\Core\MVC\Symfony\Cache\Http\SignalSlot;
8
9
use eZ\Publish\Core\MVC\Symfony\Cache\GatewayCachePurger;
10
use eZ\Publish\Core\SignalSlot\Signal;
11
use eZ\Publish\Core\SignalSlot\Slot;
12
use eZ\Publish\Core\SignalSlot\Signal\URLService\UpdateUrlSignal;
13
14
/**
15
 * A slot handling UpdateUrlSignal.
16
 *
17
 * @deprecated since 6.8. The platform-http-cache package defines slots for http-cache multi-tagging.
18
 */
19
class UpdateUrlSlot extends Slot
20
{
21
    /**
22
     * @var \eZ\Publish\Core\MVC\Symfony\Cache\GatewayCachePurger
23
     */
24
    protected $httpCacheClearer;
25
26
    /**
27
     * UpdateUrlSlot constructor.
28
     *
29
     * @param GatewayCachePurger $httpCacheClearer
30
     */
31
    public function __construct(GatewayCachePurger $httpCacheClearer)
32
    {
33
        $this->httpCacheClearer = $httpCacheClearer;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function receive(Signal $signal)
40
    {
41
        if ($signal instanceof UpdateUrlSignal) {
42
            $this->httpCacheClearer->purgeAll();
43
        }
44
    }
45
}
46