Completed
Push — master ( 9eb60a...7a0a03 )
by Colin
36:39 queued 35:14
created

Image::__construct()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 12

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
dl 0
loc 12
ccs 0
cts 10
cp 0
rs 9.8666
c 0
b 0
f 0
cc 3
nc 4
nop 3
crap 12
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
    public function __construct(string $url, ?string $label = null, ?string $title = null)
22
    {
23
        parent::__construct($url);
24
25
        if (!empty($label)) {
26
            $this->appendChild(new Text($label));
27
        }
28
29
        if (!empty($title)) {
30
            $this->data['title'] = $title;
31
        }
32
    }
33
}
34