Completed
Push — master ( 3d485f...407dff )
by Paweł
66:49
created

RevisionContext   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 67
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getCurrentRevision() 0 4 1
A setCurrentRevision() 0 4 1
A getPublishedRevision() 0 4 1
A setPublishedRevision() 0 4 1
A getWorkingRevision() 0 4 1
A setWorkingRevision() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the Superdesk Publisher Revision Component.
7
 *
8
 * Copyright 2017 Sourcefabric z.u. and contributors.
9
 *
10
 * For the full copyright and license information, please see the
11
 * AUTHORS and LICENSE files distributed with this source code.
12
 *
13
 * @copyright 2015 Sourcefabric z.ú
14
 * @license http://www.superdesk.org/license
15
 */
16
17
namespace SWP\Component\Revision\Context;
18
19
use SWP\Component\Revision\Model\RevisionInterface;
20
21
/**
22
 * Class RevisionContext.
23
 */
24
class RevisionContext implements RevisionContextInterface
25
{
26
    const REVISION_PARAMETER_NAME = 'swp_revision_key';
27
28
    /**
29
     * @var RevisionInterface
30
     */
31
    protected $currentRevision;
32
33
    /**
34
     * @var RevisionInterface
35
     */
36
    protected $publishedRevision;
37
38
    /**
39
     * @var RevisionInterface
40
     */
41
    protected $workingRevision;
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getCurrentRevision(): RevisionInterface
47
    {
48
        return $this->currentRevision;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function setCurrentRevision(RevisionInterface $revision)
55
    {
56
        $this->currentRevision = $revision;
57
    }
58
59
    /**
60
     * {@inheritdoc}
61
     */
62
    public function getPublishedRevision(): RevisionInterface
63
    {
64
        return $this->publishedRevision;
65
    }
66
67
    /**
68
     * {@inheritdoc}
69
     */
70
    public function setPublishedRevision(RevisionInterface $revision)
71
    {
72
        $this->publishedRevision = $revision;
73
    }
74
75
    /**
76
     * {@inheritdoc}
77
     */
78
    public function getWorkingRevision()
79
    {
80
        return $this->workingRevision;
81
    }
82
83
    /**
84
     * {@inheritdoc}
85
     */
86
    public function setWorkingRevision(RevisionInterface $revision)
87
    {
88
        $this->workingRevision = $revision;
89
    }
90
}
91