@@ -27,7 +27,7 @@ class TypeGenerator
2727 public const GRAPHQL_SERVICES = 'services ' ;
2828
2929 private static bool $ classMapLoaded = false ;
30- public TypeGeneratorOptions $ options ;
30+ private TypeGeneratorOptions $ options ;
3131 private TypeBuilder $ typeBuilder ;
3232 private EventDispatcherInterface $ dispatcher ;
3333
@@ -40,7 +40,7 @@ public function __construct(TypeBuilder $typeBuilder, EventDispatcherInterface $
4040
4141 public function compile (int $ mode ): array
4242 {
43- $ cacheDir = $ this ->options -> getCacheDirOrDefault ();
43+ $ cacheDir = $ this ->getCacheDirOrDefault ();
4444 $ writeMode = $ mode & self ::MODE_WRITE ;
4545
4646 // Configure write mode
@@ -122,8 +122,33 @@ public function loadClasses(bool $forceReload = false): void
122122 }
123123 }
124124
125+ public function getCacheDir (): ?string
126+ {
127+ return $ this ->options ->cacheDir ;
128+ }
129+
130+ public function getCacheDirMask (): int
131+ {
132+ return $ this ->options ->cacheDirMask ;
133+ }
134+
135+ public function getCacheBaseDir (): ?string
136+ {
137+ return $ this ->options ->cacheBaseDir ;
138+ }
139+
140+ public function setCacheBaseDir (string $ dir ): void
141+ {
142+ $ this ->options ->cacheBaseDir = $ dir ;
143+ }
144+
145+ public function getCacheDirOrDefault (): string
146+ {
147+ return $ this ->options ->cacheDir ?? $ this ->options ->cacheBaseDir .'/overblog/graphql-bundle/__definitions__ ' ;
148+ }
149+
125150 private function getClassesMap (): string
126151 {
127- return $ this ->options -> getCacheDirOrDefault ().'/__classes.map ' ;
152+ return $ this ->getCacheDirOrDefault ().'/__classes.map ' ;
128153 }
129154}
0 commit comments