Passed
Push — master ( 22c836...715de5 )
by Jan
03:12
created

ToolsTreeBuilder::getTree()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 11
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * part-db version 0.1
4
 * Copyright (C) 2005 Christoph Lechner
5
 * http://www.cl-projects.de/.
6
 *
7
 * part-db version 0.2+
8
 * Copyright (C) 2009 K. Jacobs and others (see authors.php)
9
 * http://code.google.com/p/part-db/
10
 *
11
 * Part-DB Version 0.4+
12
 * Copyright (C) 2016 - 2019 Jan Böhmer
13
 * https://github.com/jbtronics
14
 *
15
 * This program is free software; you can redistribute it and/or
16
 * modify it under the terms of the GNU General Public License
17
 * as published by the Free Software Foundation; either version 2
18
 * of the License, or (at your option) any later version.
19
 *
20
 * This program is distributed in the hope that it will be useful,
21
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
 * GNU General Public License for more details.
24
 *
25
 * You should have received a copy of the GNU General Public License
26
 * along with this program; if not, write to the Free Software
27
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
28
 */
29
30
namespace App\Services;
31
32
use App\Helpers\TreeViewNode;
33
34
/**
35
 * This Service generates the tree structure for the tools.
36
 * @package App\Services
37
 */
38
class ToolsTreeBuilder
39
{
40
41
    /**
42
     * Generates the tree for the tools menu.
43
     * @return TreeViewNode The array containing all Nodes for the tools menu.
44
     */
45
    public function getTree() : array
46
    {
47
        //TODO: Use proper values
48
49
        $nodes = array();
50
        $nodes[] = new TreeViewNode('Node 1');
51
        $nodes[] = new TreeViewNode('Node 2');
52
53
        $tree[] = new TreeViewNode('test', 'www.google.de', $nodes);
0 ignored issues
show
Comprehensibility Best Practice introduced by
$tree was never initialized. Although not strictly required by PHP, it is generally a good practice to add $tree = array(); before regardless.
Loading history...
54
55
        return $tree;
56
    }
57
}
58