Comment::specialProcess()   A
last analyzed

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
use Dallgoot\Yaml\Nodes\Generic\NodeGeneric;
6
7
/**
8
 *
9
 * @author  Stéphane Rebai <[email protected]>
10
 * @license Apache 2.0
11
 * @link    https://github.com/dallgoot/yaml
12
 */
13
class Comment extends NodeGeneric
14
{
15 1
     public function specialProcess(NodeGeneric &$previous, array &$emptyLines): bool
16
     {
17 1
          $previous->getRoot()->add($this);
18 1
          return true;
19
     }
20
21 1
     public function build(&$parent = null)
22
     {
23 1
          $root = $this->getRoot();
24 1
          $yamlObject = $root->getYamlObject();
25 1
          $yamlObject->addComment($this->line, $this->raw);
26 1
          return null;
27
     }
28
}
29