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

AnchorLink::toArray()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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