Passed
Push — develop ( 683c8d...07cc15 )
by Daniel
05:33
created

FileTrait::setFilePath()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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