Link   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 3
1
<?php
2
3
/*
4
 * This file is part of the league/commonmark package.
5
 *
6
 * (c) Colin O'Dell <[email protected]>
7
 *
8
 * Original code based on the CommonMark JS reference parser (https://bitly.com/commonmark-js)
9
 *  - (c) John MacFarlane
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 */
14
15
namespace League\CommonMark\Inline\Element;
16
17
class Link extends AbstractWebResource
18
{
19
    /**
20
     * @param string      $url
21
     * @param string|null $label
22
     * @param string|null $title
23
     */
24 366
    public function __construct(string $url, ?string $label = null, ?string $title = null)
25
    {
26 366
        parent::__construct($url);
27
28 366
        if (!empty($label)) {
29 72
            $this->appendChild(new Text($label));
30
        }
31
32 366
        if (!empty($title)) {
33 93
            $this->data['title'] = $title;
34
        }
35 366
    }
36
}
37