ManufacturerUrlSuffixProvider   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 23
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getUrlSuffix() 0 3 1
A __construct() 0 3 1
1
<?php
2
/**
3
 * File: ManufacturerUrlSuffixProvider.php
4
 *
5
 * @author      Maciej Sławik <[email protected]>
6
 * Github:      https://github.com/maciejslawik
7
 */
8
9
namespace MSlwk\Otomoto\App\Manufacturer\Url;
10
11
use MSlwk\Otomoto\App\Manufacturer\Data\ManufacturerDTOInterface;
12
use MSlwk\Otomoto\App\Slugify\SlugifierInterface;
13
14
/**
15
 * Class ManufacturerUrlSuffixProvider
16
 * @package MSlwk\Otomoto\App\Manufacturer\Url
17
 */
18
class ManufacturerUrlSuffixProvider implements ManufacturerUrlSuffixProviderInterface
19
{
20
    /**
21
     * @var SlugifierInterface
22
     */
23
    private $slugifier;
24
25
    /**
26
     * ManufacturerUrlSuffixProvider constructor.
27
     * @param SlugifierInterface $slugifier
28
     */
29 3
    public function __construct(SlugifierInterface $slugifier)
30
    {
31 3
        $this->slugifier = $slugifier;
32 3
    }
33
34
    /**
35
     * @param ManufacturerDTOInterface $manufacturerDTO
36
     * @return string
37
     */
38 1
    public function getUrlSuffix(ManufacturerDTOInterface $manufacturerDTO): string
39
    {
40 1
        return "/osobowe/{$this->slugifier->slugify($manufacturerDTO->getName())}/";
41
    }
42
}
43