Completed
Push — ezp-30882-thumbnail ( 274ed9 )
by
unknown
19:23
created

StaticStrategy   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getThumbnail() 0 4 1
1
<?php
2
3
namespace eZ\Publish\Core\Repository\Strategy\ContentThumbnail;
4
5
use eZ\Publish\API\Repository\Values\ContentType\ContentType;
6
use eZ\Publish\SPI\Repository\Strategy\ContentThumbnail\ThumbnailStrategy;
7
8
class StaticStrategy implements ThumbnailStrategy
9
{
10
    /** @var string */
11
    private $staticThumbnail;
12
13
    public function __construct(string $staticThumbnail)
14
    {
15
        $this->staticThumbnail = $staticThumbnail;
16
    }
17
18
    public function getThumbnail(ContentType $contentType, array $fields): ?string
19
    {
20
        return $this->staticThumbnail;
21
    }
22
}