File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class NodeTemplateCommandController extends CommandController
3131 * @param string $workspaceName
3232 * @return void
3333 */
34- public function createFromNodeSubtree (string $ startingNodeId , string $ workspaceName = 'live ' ): void
34+ public function createFromNodeSubtreeCommand (string $ startingNodeId , string $ workspaceName = 'live ' ): void
3535 {
3636 $ subgraph = $ this ->contentContextFactory ->create ([
3737 'workspaceName ' => $ workspaceName
Original file line number Diff line number Diff line change @@ -42,17 +42,21 @@ public function createNodeTemplateYamlDumpFromSubtree(NodeInterface $startingNod
4242
4343 $ template = $ this ->nodeTemplateFromNodes ([$ startingNode ], $ comments );
4444
45+ $ firstEntry = null ;
4546 foreach ($ template as $ firstEntry ) {
4647 break ;
4748 }
48- assert (isset ($ firstEntry ));
49+
50+ $ properties = $ firstEntry ['properties ' ] ?? null ;
51+ $ childNodes = $ firstEntry ['childNodes ' ] ?? null ;
52+
4953
5054 $ templateInNodeTypeOptions = [
5155 $ nodeType ->getName () => [
5256 'options ' => [
5357 'template ' => array_filter ([
54- 'properties ' => $ firstEntry [ ' properties ' ] ?? null ,
55- 'childNodes ' => $ firstEntry [ ' childNodes ' ] ?? null ,
58+ 'properties ' => $ properties ,
59+ 'childNodes ' => $ childNodes
5660 ])
5761 ]
5862 ]
You can’t perform that action at this time.
0 commit comments