@@ -33,16 +33,23 @@ public function load(array $configs, ContainerBuilder $container)
33
33
$ configuration = new Configuration ();
34
34
$ config = $ this ->processConfiguration ($ configuration , $ configs );
35
35
36
- //$config = $this->processConfiguration($this->getConfiguration($config, $container), $config);
37
36
$ loader = new XmlFileLoader ($ container , new FileLocator (__DIR__ .'/../Resources/config/container ' ));
38
37
39
38
if (isset ($ configs [0 ]['namespace ' ]['controllers ' ])) {
40
- $ namespaceController = array_map (function ($ namespace ) { return rtrim ($ namespace , '\\' ) . '\\' ; }, $ configs [0 ]['namespace ' ]['controllers ' ]);
39
+ $ controllers = $ configs [0 ]['namespace ' ]['controllers ' ];
40
+ if (!is_array ($ controllers )) {
41
+ $ controllers = [ $ controllers ];
42
+ }
43
+ $ namespaceController = array_map (function ($ namespace ) { return rtrim ($ namespace , '\\' ) . '\\' ; }, $ controllers );
41
44
} else {
42
45
$ namespaceController = [];
43
46
}
44
47
if (isset ($ configs [0 ]['namespace ' ]['types ' ])) {
45
- $ namespaceType = array_map (function ($ namespace ) { return rtrim ($ namespace , '\\' ) . '\\' ; }, $ configs [0 ]['namespace ' ]['types ' ]);
48
+ $ types = $ configs [0 ]['namespace ' ]['types ' ];
49
+ if (!is_array ($ types )) {
50
+ $ types = [ $ types ];
51
+ }
52
+ $ namespaceType = array_map (function ($ namespace ) { return rtrim ($ namespace , '\\' ) . '\\' ; }, $ types );
46
53
} else {
47
54
$ namespaceType = [];
48
55
}
@@ -62,24 +69,6 @@ public function load(array $configs, ContainerBuilder $container)
62
69
63
70
$ container ->registerForAutoconfiguration (ObjectType::class)
64
71
->addTag ('graphql.output_type ' );
65
-
66
-
67
- /*$definition = $container->getDefinition(Configuration::class);
68
- $definition->replaceArgument(0, $config['bean_namespace']);
69
- $definition->replaceArgument(1, $config['dao_namespace']);
70
-
71
- if (isset($config['naming'])) {
72
- $definitionNamingStrategy = $container->getDefinition(\TheCodingMachine\TDBM\Utils\DefaultNamingStrategy::class);
73
- $definitionNamingStrategy->addMethodCall('setBeanPrefix', [$config['naming']['bean_prefix']]);
74
- $definitionNamingStrategy->addMethodCall('setBeanSuffix', [$config['naming']['bean_suffix']]);
75
- $definitionNamingStrategy->addMethodCall('setBaseBeanPrefix', [$config['naming']['base_bean_prefix']]);
76
- $definitionNamingStrategy->addMethodCall('setBaseBeanSuffix', [$config['naming']['base_bean_suffix']]);
77
- $definitionNamingStrategy->addMethodCall('setDaoPrefix', [$config['naming']['dao_prefix']]);
78
- $definitionNamingStrategy->addMethodCall('setDaoSuffix', [$config['naming']['dao_suffix']]);
79
- $definitionNamingStrategy->addMethodCall('setBaseDaoPrefix', [$config['naming']['base_dao_prefix']]);
80
- $definitionNamingStrategy->addMethodCall('setBaseDaoSuffix', [$config['naming']['base_dao_suffix']]);
81
- $definitionNamingStrategy->addMethodCall('setExceptions', [$config['naming']['exceptions']]);
82
- }*/
83
72
}
84
73
85
74
private function getNamespaceDir (string $ namespace ): string
0 commit comments