This repository was archived by the owner on Sep 16, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Expand file tree Collapse file tree 1 file changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -32,23 +32,6 @@ public function __construct(TreeInterface $tree)
32
32
$ this ->tree = $ tree ;
33
33
}
34
34
35
- /**
36
- * Helper method to deliver a json node
37
- *
38
- * @param string $path Node to process
39
- * @param string $method Method to execute on the node
40
- *
41
- * @return Response
42
- */
43
- protected function processNode ($ path , $ method )
44
- {
45
- if (empty ($ path )) {
46
- $ path = '/ ' ;
47
- }
48
-
49
- return new JsonResponse ($ this ->tree ->$ method ($ path ));
50
- }
51
-
52
35
/**
53
36
* Get a json encoded list of children the specified node has
54
37
*
@@ -61,7 +44,12 @@ protected function processNode($path, $method)
61
44
public function childrenAction (Request $ request )
62
45
{
63
46
$ path = $ request ->query ->get ('root ' );
64
- return $ this ->processNode ($ path , "getChildren " );
47
+
48
+ if (empty ($ path )) {
49
+ $ path = '/ ' ;
50
+ }
51
+
52
+ return new JsonResponse ($ this ->tree ->getChildren ($ path ));
65
53
}
66
54
67
55
/**
@@ -75,7 +63,12 @@ public function childrenAction(Request $request)
75
63
public function propertiesAction (Request $ request )
76
64
{
77
65
$ path = $ request ->query ->get ('root ' );
78
- return $ this ->processNode ($ path , "getProperties " );
66
+
67
+ if (empty ($ path )) {
68
+ $ path = '/ ' ;
69
+ }
70
+
71
+ return new JsonResponse ($ this ->tree ->getProperties ($ path ));
79
72
}
80
73
81
74
/**
You can’t perform that action at this time.
0 commit comments