Completed
Push — master ( 178130...678bac )
by Paweł
15:27
created

ImageRendition   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 13
lcom 1
cbo 2
dl 0
loc 83
ccs 0
cts 14
cp 0
rs 10
c 0
b 0
f 0

13 Methods

Rating   Name   Duplication   Size   Complexity  
A getMedia() 0 4 1
A setMedia() 0 4 1
A getImage() 0 4 1
A setImage() 0 4 1
A getId() 0 4 1
A setId() 0 4 1
A getWidth() 0 4 1
A setWidth() 0 4 1
A getHeight() 0 4 1
A setHeight() 0 4 1
A getName() 0 4 1
A setName() 0 4 1
A isConvertedToWebp() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Superdesk Web Publisher Content Bundle.
5
 *
6
 * Copyright 2016 Sourcefabric z.ú. and contributors.
7
 *
8
 * For the full copyright and license information, please see the
9
 * AUTHORS and LICENSE files distributed with this source code.
10
 *
11
 * @copyright 2016 Sourcefabric z.ú
12
 * @license http://www.superdesk.org/license
13
 */
14
15
namespace SWP\Bundle\ContentBundle\Model;
16
17
class ImageRendition implements ImageRenditionInterface
18
{
19
    use PreviewUrlAwareTrait;
20
21
    protected $width;
22
23
    protected $height;
24
25
    protected $name;
26
27
    protected $id;
28
29
    protected $image;
30
31
    protected $media;
32
33
    protected $convertedToWebp;
34
35
    public function getMedia(): ArticleMediaInterface
36
    {
37
        return $this->media;
38
    }
39
40
    public function setMedia(ArticleMediaInterface $media): void
41
    {
42
        $this->media = $media;
43
    }
44
45
    public function getImage(): ImageInterface
46
    {
47
        return $this->image;
48
    }
49
50
    public function setImage(ImageInterface $image): void
51
    {
52
        $this->image = $image;
53
    }
54
55
    public function getId(): ?int
56
    {
57
        return $this->id;
58
    }
59
60
    public function setId(?int $id)
61
    {
62
        $this->id = $id;
63
    }
64
65
    public function getWidth(): int
66
    {
67
        return $this->width;
68
    }
69
70
    public function setWidth(int $width): void
71
    {
72
        $this->width = $width;
73
    }
74
75
    public function getHeight(): int
76
    {
77
        return $this->height;
78
    }
79
80
    public function setHeight(int $height): void
81
    {
82
        $this->height = $height;
83
    }
84
85
    public function getName(): string
86
    {
87
        return $this->name;
88
    }
89
90
    public function setName(string $name): void
91
    {
92
        $this->name = $name;
93
    }
94
95
    public function isConvertedToWebp(): bool
96
    {
97
        return $this->getImage()->hasVariant(ImageInterface::VARIANT_WEBP);
98
    }
99
}
100