Completed
Push — master ( c45521...844759 )
by stéphane
08:22
created

NodeBlank   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A needsSpecialProcess() 0 14 3
1
<?php
2
3
namespace Dallgoot\Yaml;
4
5
/**
6
 *
7
 * @author  Stéphane Rebai <[email protected]>
8
 * @license Apache 2.0
9
 * @link    TODO : url to specific online doc
10
 */
11
class NodeBlank extends Node
12
{
13
    public function needsSpecialProcess(Node &$previous, array &$emptyLines):bool
14
    {
15
        $deepest = $previous->getDeepestNode();
16
        //what first character to determine if escaped sequence are allowed
17
        //if this is empty $separator depends on previous last character (escape slash)
18
        $separator = ' ';
0 ignored issues
show
Unused Code introduced by
The assignment to $separator is dead and can be removed.
Loading history...
19
        // if ($deepest->value[-1] !== "\\") {
20
        //     $deepest->parse(($deepest->value)."\n");
21
        // } else {
22
            // $this->specialProcess($previous, $emptyLines);
23
        // }
24
               if ($previous instanceof NodeScalar)   $emptyLines[] = $this->setParent($previous->getParent());
25
        if ($deepest instanceof NodeLiterals) $emptyLines[] = $this->setParent($deepest);
26
        return true;
27
    }
28
29
    // public function specialProcess(Node &$previous, array &$emptyLines)
30
    // {
31
    //     if ($previous instanceof NodeScalar)   $emptyLines[] = $this->setParent($previous->getParent());
32
    //     if ($deepest instanceof NodeLiterals) $emptyLines[] = $this->setParent($deepest);
33
    // }
34
}