Completed
Push — master ( 7cfa55...f98783 )
by Colin
10:32 queued 09:06
created

AbstractInline   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getData() 0 4 2
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
use League\CommonMark\Node\Node;
18
19
abstract class AbstractInline extends Node
20
{
21
    /**
22
     * @var array
23
     *
24
     * Used for storage of arbitrary data
25
     */
26
    public $data = [];
27
28
    /**
29
     * @return bool
30
     */
31 1656
    public function isContainer(): bool
32
    {
33 1656
        return false;
34
    }
35
36
    /**
37
     * @param string $key
38
     * @param mixed  $default
39
     *
40
     * @return mixed
41
     */
42 783
    public function getData(string $key, $default = null)
43
    {
44 783
        return isset($this->data[$key]) ? $this->data[$key] : $default;
45
    }
46
}
47