Completed
Push — 7.5 ( 13f815...467086 )
by André
19:24
created

ContentDraftListItem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getVersionInfo() 0 4 1
A hasVersionInfo() 0 4 1
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
declare(strict_types=1);
8
9
namespace eZ\Publish\API\Repository\Values\Content\DraftList\Item;
10
11
use eZ\Publish\API\Repository\Values\Content\DraftList\ContentDraftListItemInterface;
12
use eZ\Publish\API\Repository\Values\Content\VersionInfo;
13
14
/**
15
 * Item of content drafts list.
16
 */
17
class ContentDraftListItem implements ContentDraftListItemInterface
18
{
19
    /**
20
     * @var \eZ\Publish\API\Repository\Values\Content\VersionInfo
21
     */
22
    private $versionInfo;
23
24
    /**
25
     * @param \eZ\Publish\API\Repository\Values\Content\VersionInfo $versionInfo
26
     */
27
    public function __construct(VersionInfo $versionInfo)
28
    {
29
        $this->versionInfo = $versionInfo;
30
    }
31
32
    /**
33
     * @return \eZ\Publish\API\Repository\Values\Content\VersionInfo|null
34
     */
35
    public function getVersionInfo(): ?VersionInfo
36
    {
37
        return $this->versionInfo;
38
    }
39
40
    /**
41
     * @return bool
42
     */
43
    public function hasVersionInfo(): bool
44
    {
45
        return $this->versionInfo instanceof VersionInfo;
46
    }
47
}
48