BrandImage::isLogo()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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