22
33namespace Phpro \SoapClient \CodeGenerator ;
44
5+ use Phpro \SoapClient \CodeGenerator \Config \ClassMapConfig ;
56use Phpro \SoapClient \CodeGenerator \Context \ClassMapContext ;
67use Phpro \SoapClient \CodeGenerator \Context \FileContext ;
7- use Phpro \SoapClient \CodeGenerator \Model \Type ;
88use Phpro \SoapClient \CodeGenerator \Model \TypeMap ;
99use Phpro \SoapClient \CodeGenerator \Rules \RuleSetInterface ;
1010use Laminas \Code \Generator \FileGenerator ;
1414 */
1515class ClassMapGenerator implements GeneratorInterface
1616{
17- /**
18- * @var RuleSetInterface
19- */
20- private $ ruleSet ;
21-
22- /**
23- * @var string
24- */
25- private $ name ;
26-
27- /**
28- * @var string
29- */
30- private $ namespace ;
31-
32- /**
33- * TypeGenerator constructor.
34- *
35- * @param RuleSetInterface $ruleSet
36- * @param string $name
37- * @param string $namespace
38- */
39- public function __construct (RuleSetInterface $ ruleSet , string $ name , string $ namespace )
40- {
41- $ this ->ruleSet = $ ruleSet ;
42- $ this ->name = $ name ;
43- $ this ->namespace = $ namespace ;
17+ public function __construct (
18+ private RuleSetInterface $ ruleSet ,
19+ private ClassMapConfig $ classMap
20+ ) {
4421 }
4522
4623 /**
@@ -51,7 +28,7 @@ public function __construct(RuleSetInterface $ruleSet, string $name, string $nam
5128 */
5229 public function generate (FileGenerator $ file , $ typeMap ): string
5330 {
54- $ this ->ruleSet ->applyRules (new ClassMapContext ($ file , $ typeMap , $ this ->name , $ this -> namespace ));
31+ $ this ->ruleSet ->applyRules (new ClassMapContext ($ file , $ typeMap , $ this ->classMap ));
5532 $ this ->ruleSet ->applyRules (new FileContext ($ file ));
5633
5734 return $ file ->generate ();
0 commit comments