Passed
Push — master ( 6b8e06...02b784 )
by stéphane
04:35
created

NodeList::__debugInfo()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Dallgoot\Yaml;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
use Dallgoot\Yaml\Yaml as Y;
5
6
/**
7
 * TODO
8
 *
9
 * @author  Stéphane Rebai <[email protected]>
10
 * @license Apache 2.0
11
 * @link    TODO : url to specific online doc
12
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
13
class NodeList extends \SplDoublyLinkedList
14
{
15
    /* @var null|int */
16
    public $type = null;
17
18
    /**
19
     * NodeList constructor
20
     */
21
    public function __construct()
22
    {
23
        $this->setIteratorMode(NodeList::IT_MODE_KEEP);
24
    }
25
26
    /**
27
     * Gets the types of the elements in this NodeList
28
     *
29
     * @return integer The &-sum of all the types.
30
     */
31
    public function getTypes():int
32
    {
33
        $types = 0;
34
        foreach ($this as $child) {
35
            $types |= $child->type;
36
        }
37
        return $types;
38
    }
39
40
    /**
41
     * Provides a slimmer output when using var_dump Note: currently PHP ignores it on SPL types
42
     * @todo activate when PHP allows it
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
43
     */
44
    // public function __debugInfo()
45
    // {
46
    //     return ['type'=> Y::getName($this->type), 'dllist'=> $this->dllist];
47
    // }
48
}
49