Passed
Push — master ( f81cc4...5281ab )
by stéphane
04:50
created

Comment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 14
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 6 1
A specialProcess() 0 4 1
1
<?php
2
3
namespace Dallgoot\Yaml\Nodes;
4
5
/**
6
 *
7
 * @author  Stéphane Rebai <[email protected]>
8
 * @license Apache 2.0
9
 * @link    https://github.com/dallgoot/yaml
10
 */
11
class Comment extends NodeGeneric
12
{
13 1
   public function specialProcess(NodeGeneric &$previous, array &$emptyLines):bool
14
   {
15 1
        $previous->getRoot()->add($this);
16 1
        return true;
17
   }
18
19 1
   public function build(&$parent = null)
20
   {
21 1
        $root = $this->getRoot();
22 1
        $yamlObject = $root->getYamlObject();
23 1
        $yamlObject->addComment($this->line, $this->raw);
24 1
        return null;
25
   }
26
}