Completed
Push — master ( 7a0a03...73b89e )
by Colin
02:28
created

Image   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 15
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 15
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\Extension\CommonMark\Node\Inline;
16
17
use League\CommonMark\Node\Inline\Text;
18
19
class Image extends AbstractWebResource
20
{
21 84
    public function __construct(string $url, ?string $label = null, ?string $title = null)
22
    {
23 84
        parent::__construct($url);
24
25 84
        if (!empty($label)) {
26 6
            $this->appendChild(new Text($label));
27
        }
28
29 84
        if (!empty($title)) {
30 39
            $this->data['title'] = $title;
31
        }
32 84
    }
33
}
34