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

FileTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getFilePath() 0 3 1
A getImagineFilters() 0 5 1
A setFilePath() 0 3 1
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