Completed
Push — http_cache_slots ( c4b669 )
by
unknown
13:55
created

AbstractContentSlotTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 33
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
B generateTags() 0 23 4
1
<?php
2
3
/**
4
 * This file is part of the eZ Publish Kernel package.
5
 *
6
 * @copyright Copyright (C) eZ Systems AS. All rights reserved.
7
 * @license For full copyright and license information view LICENSE file distributed with this source code.
8
 */
9
namespace eZ\Publish\Core\MVC\Symfony\Cache\Tests\Http\SignalSlot;
10
11
abstract class AbstractContentSlotTest extends AbstractSlotTest
12
{
13
    protected $contentId = 42;
14
    protected $locationId = null;
15
    protected $parentLocationId = null;
16
17
    /**
18
     * @return array
19
     */
20
    public function generateTags()
21
    {
22
        $tags = [];
23
        if ($this->contentId) {
24
            $tags = ['content-' . $this->contentId, 'relation-' . $this->contentId];
25
        }
26
27
        if ($this->locationId) {
28
            // self(s)
29
            $tags[] = 'location-' . $this->locationId;
30
            // children
31
            $tags[] = 'parent-' . $this->locationId;
32
        }
33
34
        if ($this->parentLocationId) {
35
            // parent(s)
36
            $tags[] = 'location-' . $this->parentLocationId;
37
            // siblings
38
            $tags[] = 'parent-' . $this->parentLocationId;
39
        }
40
41
        return $tags;
42
    }
43
}
44