Test Failed
Push — feature-laravel-5.4 ( 2b4b90...5bfdc4 )
by Kirill
03:52
created

AnchorLink   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A toArray() 0 8 1
1
<?php
2
/**
3
 * This file is part of laravel.su package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
declare(strict_types = 1);
9
10
namespace App\Services\ContentRenderer\Anchors;
11
12
use Illuminate\Contracts\Support\Arrayable;
13
14
/**
15
 * Class AnchorLink.
16
 */
17
class AnchorLink implements Arrayable
18
{
19
    /**
20
     * @var string
21
     */
22
    private $anchor;
23
24
    /**
25
     * @var string
26
     */
27
    private $title;
28
29
    /**
30
     * @var string
31
     */
32
    private $level;
33
34
    /**
35
     * AnchorLink constructor.
36
     *
37
     * @param string $anchor
38
     * @param string $title
39
     * @param string $level
40
     */
41
    public function __construct(string $anchor, string $title, string $level)
42
    {
43
        $this->anchor = $anchor;
44
        $this->title = $title;
45
        $this->level = $level;
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    public function toArray(): array
52
    {
53
        return [
54
            'anchor' => $this->anchor,
55
            'title'  => $this->title,
56
            'level'  => $this->level,
57
        ];
58
    }
59
}
60