TimelineCategory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getTimelineUrlPrefix() 0 3 1
1
<?php
2
3
namespace Osnova\Services\Timeline\Owners;
4
5
use Osnova\Services\Timeline\Interfaces\TimelineOwnerInterface;
6
7
class TimelineCategory implements TimelineOwnerInterface
8
{
9
    /** @var string */
10
    protected $name;
11
12
    /**
13
     * TimelineCategory constructor.
14
     *
15
     * @param string $name
16
     */
17
    public function __construct(string $name)
18
    {
19
        $this->name = $name;
20
    }
21
22
    /**
23
     * Get the timeline URL prefix.
24
     *
25
     * @return string
26
     */
27
    public function getTimelineUrlPrefix()
28
    {
29
        return 'timeline/'.trim($this->name, '/');
30
    }
31
}
32