Newline   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 24
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getType() 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
class Newline extends AbstractInline
18
{
19
    // Any changes to these constants should be reflected in .phpstorm.meta.php
20
    const HARDBREAK = 0;
21
    const SOFTBREAK = 1;
22
23
    protected $type;
24
25
    /**
26
     * @param int $breakType
27
     */
28 426
    public function __construct(int $breakType = self::HARDBREAK)
29
    {
30 426
        $this->type = $breakType;
31 426
    }
32
33
    /**
34
     * @return int
35
     */
36 240
    public function getType(): int
37
    {
38 240
        return $this->type;
39
    }
40
}
41