Passed
Push — develop ( ccb2a4...f8b469 )
by Daniel
06:28
created

FileTrait::getImagineFilters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 2
cts 2
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Content;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Symfony\Component\Serializer\Annotation\Groups;
7
8
/**
9
 * Trait FileTrait
10
 * @package Silverback\ApiComponentBundle\Entity\Content\Component
11
 */
12
trait FileTrait
13
{
14
    /**
15
     * @ORM\Column(type="string", nullable=false)
16
     * @Groups({"component"})
17
     * @var null|string
18
     */
19
    protected $filePath;
20
21
    /**
22
     * @return null|string
23
     */
24 4
    public function getFilePath(): ?string
25
    {
26 4
        return $this->filePath;
27
    }
28
29
    /**
30
     * @param null|string $filePath
31
     */
32 4
    public function setFilePath(?string $filePath): void
33
    {
34 4
        $this->filePath = $filePath;
35 4
    }
36
37 1
    public static function getImagineFilters(): array
38
    {
39
        return [
40 1
            'thumbnailPath' => 'thumbnail',
41
            'placeholderPath' => 'placeholder_square'
42
        ];
43
    }
44
}
45