TimelineCategory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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