44
55namespace RZ \Roadiz \Typescript \Declaration ;
66
7- use RZ \Roadiz \Contracts \NodeType \NodeTypeClassLocatorInterface ;
87use RZ \Roadiz \Contracts \NodeType \NodeTypeFieldInterface ;
98use RZ \Roadiz \Contracts \NodeType \NodeTypeInterface ;
109use RZ \Roadiz \Typescript \Declaration \Generators \AbstractFieldGenerator ;
1817
1918final readonly class DeclarationGeneratorFactory
2019{
21- public function __construct (
22- private ParameterBag $ nodeTypesBag ,
23- private NodeTypeClassLocatorInterface $ nodeTypeClassLocator ,
24- ) {
20+ public function __construct (private ParameterBag $ nodeTypesBag )
21+ {
2522 }
2623
2724 public function getNodeTypesBag (): ParameterBag
@@ -38,16 +35,15 @@ public function createForNodeType(NodeTypeInterface $nodeType): NodeTypeGenerato
3835 {
3936 return new NodeTypeGenerator (
4037 $ nodeType ,
41- $ this ,
42- $ this ->nodeTypeClassLocator
38+ $ this
4339 );
4440 }
4541
4642 public function createForNodeTypeField (NodeTypeFieldInterface $ field ): AbstractFieldGenerator
4743 {
4844 return match (true ) {
4945 $ field ->isDocuments () => new DocumentsFieldGenerator ($ field , $ this ->nodeTypesBag ),
50- $ field ->isNodes () => new NodeReferencesFieldGenerator ($ this -> nodeTypeClassLocator , $ field , $ this ->nodeTypesBag ),
46+ $ field ->isNodes () => new NodeReferencesFieldGenerator ($ field , $ this ->nodeTypesBag ),
5147 $ field ->isChildrenNodes () => new ChildrenNodeFieldGenerator ($ field , $ this ->nodeTypesBag ),
5248 $ field ->isMultiple (), $ field ->isEnum () => new EnumFieldGenerator ($ field , $ this ->nodeTypesBag ),
5349 default => new ScalarFieldGenerator ($ field , $ this ->nodeTypesBag ),
0 commit comments