@@ -113,11 +113,15 @@ final class GlobTypeMapper implements TypeMapperInterface
113
113
* @var array<string,ReflectionClass>
114
114
*/
115
115
private $ classes ;
116
+ /**
117
+ * @var bool
118
+ */
119
+ private $ recursive ;
116
120
117
121
/**
118
122
* @param string $namespace The namespace that contains the GraphQL types (they must have a `@Type` annotation)
119
123
*/
120
- public function __construct (string $ namespace , TypeGenerator $ typeGenerator , InputTypeGenerator $ inputTypeGenerator , InputTypeUtils $ inputTypeUtils , ContainerInterface $ container , AnnotationReader $ annotationReader , NamingStrategy $ namingStrategy , CacheInterface $ cache , ?int $ globTtl = 2 , ?int $ mapTtl = null )
124
+ public function __construct (string $ namespace , TypeGenerator $ typeGenerator , InputTypeGenerator $ inputTypeGenerator , InputTypeUtils $ inputTypeUtils , ContainerInterface $ container , AnnotationReader $ annotationReader , NamingStrategy $ namingStrategy , CacheInterface $ cache , ?int $ globTtl = 2 , ?int $ mapTtl = null , bool $ recursive = true )
121
125
{
122
126
$ this ->namespace = $ namespace ;
123
127
$ this ->typeGenerator = $ typeGenerator ;
@@ -129,6 +133,7 @@ public function __construct(string $namespace, TypeGenerator $typeGenerator, Inp
129
133
$ this ->mapTtl = $ mapTtl ;
130
134
$ this ->inputTypeGenerator = $ inputTypeGenerator ;
131
135
$ this ->inputTypeUtils = $ inputTypeUtils ;
136
+ $ this ->recursive = $ recursive ;
132
137
}
133
138
134
139
/**
@@ -241,7 +246,7 @@ private function getClassList(): array
241
246
{
242
247
if ($ this ->classes === null ) {
243
248
$ this ->classes = [];
244
- $ explorer = new GlobClassExplorer ($ this ->namespace , $ this ->cache , $ this ->globTtl , ClassNameMapper::createFromComposerFile (null , null , true ));
249
+ $ explorer = new GlobClassExplorer ($ this ->namespace , $ this ->cache , $ this ->globTtl , ClassNameMapper::createFromComposerFile (null , null , true ), $ this -> recursive );
245
250
$ classes = $ explorer ->getClasses ();
246
251
foreach ($ classes as $ className ) {
247
252
if (!\class_exists ($ className )) {
0 commit comments