Passed
Pull Request — master (#631)
by ANTHONIUS
08:16
created

ImageMetadata   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
eloc 11
dl 0
loc 45
rs 10
c 1
b 0
f 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setKey() 0 4 1
A setBelongsTo() 0 4 1
A getBelongsTo() 0 3 1
A getKey() 0 3 1
A getOwnerFileClass() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Core\Entity;
6
7
use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM;
8
9
/**
10
 * Class ImageMetadata
11
 *
12
 * @ODM\EmbeddedDocument
13
 * @package Core\Entity
14
 */
15
class ImageMetadata implements FileMetadataInterface, ImageMetadataInterface
16
{
17
    use EntityTrait, FileMetadataTrait;
18
19
    /**
20
     * @ODM\Field(type="string", nullable=true)
21
     */
22
    protected ?string $belongsTo = null;
23
24
    /**
25
     * @ODM\Field(type="string", nullable=true)
26
     */
27
    protected ?string $key = null;
28
29
    public function getOwnerFileClass(): string
30
    {
31
        return Image::class;
32
    }
33
34
    /**
35
     * @return string|null
36
     */
37
    public function getBelongsTo(): ?string
38
    {
39
        return $this->belongsTo;
40
    }
41
42
    public function setBelongsTo(?string $belongsTo)
43
    {
44
        $this->belongsTo = $belongsTo;
45
        return $this;
46
    }
47
48
    /**
49
     * @return string|null
50
     */
51
    public function getKey(): ?string
52
    {
53
        return $this->key;
54
    }
55
56
    public function setKey(?string $key)
57
    {
58
        $this->key = $key;
59
        return $this;
60
    }
61
}