BrandImage   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A isLogo() 0 3 1
A setBrand() 0 3 1
A getBrand() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Loevgaard\SyliusBrandPlugin\Model;
6
7
use Sylius\Component\Core\Model\Image;
8
9
class BrandImage extends Image implements BrandImageInterface
10
{
11
    public const TYPE_LOGO = 'logo';
12
13
    public function isLogo(): bool
14
    {
15
        return $this->getType() === self::TYPE_LOGO;
16
    }
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function getBrand(): ?BrandInterface
22
    {
23
        /** @var BrandInterface|null $brand */
24
        $brand = $this->getOwner();
25
26
        return $brand;
27
    }
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    public function setBrand(?BrandInterface $brand): void
33
    {
34
        $this->setOwner($brand);
35
    }
36
}
37