AbstractWebResource   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 40
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getUrl() 0 4 1
A setUrl() 0 6 1
A isContainer() 0 4 1
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
abstract class AbstractWebResource extends AbstractInline
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $url;
23
24 432
    public function __construct(string $url)
25
    {
26 432
        $this->url = $url;
27 432
    }
28
29
    /**
30
     * @return string
31
     */
32 429
    public function getUrl(): string
33
    {
34 429
        return $this->url;
35
    }
36
37
    /**
38
     * @param string $url
39
     *
40
     * @return $this
41
     */
42 3
    public function setUrl(string $url)
43
    {
44 3
        $this->url = $url;
45
46 3
        return $this;
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52 3
    public function isContainer(): bool
53
    {
54 3
        return true;
55
    }
56
}
57