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

Comment::specialProcess()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
}