Completed
Push — EZP-30427 ( f2742c...7c8d0e )
by
unknown
19:22
created

ContentDraftListItem   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 29
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
    /** @var \eZ\Publish\API\Repository\Values\Content\VersionInfo */
20
    private $versionInfo;
21
22
    /**
23
     * @param $versionInfo
24
     */
25
    public function __construct(VersionInfo $versionInfo)
26
    {
27
        $this->versionInfo = $versionInfo;
28
    }
29
30
    /**
31
     * @return \eZ\Publish\API\Repository\Values\Content\VersionInfo|null
32
     */
33
    public function getVersionInfo(): ?VersionInfo
34
    {
35
        return $this->versionInfo;
36
    }
37
38
    /**
39
     * @return bool
40
     */
41
    public function hasVersionInfo(): bool
42
    {
43
        return $this->versionInfo instanceof VersionInfo;
44
    }
45
}
46