AbstractStringContainer::setContent()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 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
class AbstractStringContainer extends AbstractInline
18
{
19
    /**
20
     * @var string
21
     */
22
    protected $content = '';
23
24
    /**
25
     * @param string $contents
26
     * @param array  $data
27
     */
28 2064
    public function __construct(string $contents = '', array $data = [])
29
    {
30 2064
        $this->content = $contents;
31 2064
        $this->data = $data;
32 2064
    }
33
34
    /**
35
     * @return string
36
     */
37 1947
    public function getContent(): string
38
    {
39 1947
        return $this->content;
40
    }
41
42
    /**
43
     * @param string $contents
44
     *
45
     * @return $this
46
     */
47 843
    public function setContent(string $contents)
48
    {
49 843
        $this->content = $contents;
50
51 843
        return $this;
52
    }
53
}
54