11<?php
2+
23declare (strict_types=1 );
34
45namespace PackageFactory \NodeTypeObjects \Command ;
56
67use Neos \ContentRepository \Domain \Model \NodeType ;
78use Neos \ContentRepository \Domain \Service \NodeTypeManager ;
89use Neos \Flow \Cli \CommandController ;
10+ use Neos \Flow \Core \Bootstrap ;
911use Neos \Flow \Package \FlowPackageInterface ;
1012use Neos \Flow \Package \PackageManager ;
1113use Neos \Utility \Files ;
@@ -18,7 +20,7 @@ class NodetypeObjectsCommandController extends CommandController
1820
1921 public function injectNodeTypeManager (NodeTypeManager $ nodeTypeManager ): void
2022 {
21- $ this ->nodeTypeManager = $ nodeTypeManager ;
23+ $ this ->nodeTypeManager = $ nodeTypeManager ;
2224 }
2325
2426 public function injectPackageManager (PackageManager $ packageManager ): void
@@ -32,9 +34,9 @@ public function injectPackageManager(PackageManager $packageManager): void
3234 * @param string $packageKey PackageKey to store the classes in
3335 * @return void
3436 */
35- public function cleanCommand (string $ packageKey ):void
37+ public function cleanCommand (string $ packageKey ): void
3638 {
37- if ($ this ->packageManager ->isPackageAvailable ($ packageKey )) {
39+ if ($ this ->packageManager ->isPackageAvailable ($ packageKey )) {
3840 $ package = $ this ->packageManager ->getPackage ($ packageKey );
3941 } else {
4042 $ this ->output ->outputLine ("Unknown package " . $ packageKey );
@@ -62,9 +64,9 @@ public function cleanCommand(string $packageKey):void
6264 *
6365 * @param string $packageKey PackageKey
6466 */
65- public function buildCommand (string $ packageKey ):void
67+ public function buildCommand (string $ packageKey ): void
6668 {
67- if ($ this ->packageManager ->isPackageAvailable ($ packageKey )) {
69+ if ($ this ->packageManager ->isPackageAvailable ($ packageKey )) {
6870 $ package = $ this ->packageManager ->getPackage ($ packageKey );
6971 } else {
7072 $ this ->output ->outputLine ("Unknown package " . $ packageKey );
@@ -81,7 +83,7 @@ public function buildCommand(string $packageKey):void
8183 if (!str_starts_with ($ nodeType ->getName (), $ packageKey . ': ' )) {
8284 continue ;
8385 }
84- $ localNameParts = explode ('. ' , str_replace ( $ packageKey . ': ' ,'' , $ nodeType ->getName ()));
86+ $ localNameParts = explode ('. ' , str_replace ($ packageKey . ': ' , '' , $ nodeType ->getName ()));
8587 $ localName = array_pop ($ localNameParts );
8688 $ localNamespace = implode ('. ' , $ localNameParts );
8789
@@ -91,10 +93,10 @@ public function buildCommand(string $packageKey):void
9193 . '/ ' . $ localName ;
9294 $ fileName = $ localName . 'NodeObject.php ' ;
9395
94- $ classNamespace = str_replace ('. ' , '\\' , $ packageKey )
96+ $ classNamespace = str_replace ('. ' , '\\' , $ packageKey )
9597 . '\\NodeTypes '
96- . '\\' . str_replace ('. ' , '\\' , $ localNamespace )
97- . '\\' . str_replace ('. ' , '\\' , $ localName );
98+ . '\\' . str_replace ('. ' , '\\' , $ localNamespace )
99+ . '\\' . str_replace ('. ' , '\\' , $ localName );
98100
99101 $ className = $ localName . 'NodeObject ' ;
100102
@@ -111,7 +113,7 @@ public function buildCommand(string $packageKey):void
111113 }
112114 }
113115
114- private function buildOne (FlowPackageInterface $ package , NodeType $ nodeType , string $ classNamespace , string $ className , string $ filePath , string $ fileName ):void
116+ private function buildOne (FlowPackageInterface $ package , NodeType $ nodeType , string $ classNamespace , string $ className , string $ filePath , string $ fileName ): void
115117 {
116118
117119 $ propertyAccesssors = '' ;
@@ -130,7 +132,7 @@ private function buildOne(FlowPackageInterface $package, NodeType $nodeType, str
130132 $ annotationType = $ type ;
131133 $ phpType = 'array ' ;
132134 } elseif (str_starts_with ($ type , 'array< ' ) && str_ends_with ($ type , '> ' )) {
133- $ annotationType = substr ($ type , 6 , -1 ) . '[] ' ;
135+ $ annotationType = substr ($ type , 6 , -1 ) . '[] ' ;
134136 $ phpType = 'array ' ;
135137 } elseif ($ type === 'boolean ' ) {
136138 $ phpType = 'bool ' ;
0 commit comments