File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ You can find and compare releases at the [GitHub release page](https://github.co
9
9
10
10
## Unreleased
11
11
12
+ ### Added
13
+
14
+ - Add ` path() ` method to ` ASTCache ` class https://github.com/nuwave/lighthouse/pull/2694
15
+
12
16
## v6.58.0
13
17
14
18
### Changed
Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ public function isEnabled(): bool
34
34
return $ this ->enable ;
35
35
}
36
36
37
+ public function path (): string
38
+ {
39
+ return $ this ->path ;
40
+ }
41
+
37
42
public function set (DocumentAST $ documentAST ): void
38
43
{
39
44
$ variable = var_export (
@@ -42,24 +47,25 @@ public function set(DocumentAST $documentAST): void
42
47
);
43
48
44
49
$ this ->filesystem ()->put (
45
- path: $ this ->path ,
50
+ path: $ this ->path () ,
46
51
contents: /** @lang PHP */ "<?php return {$ variable }; " ,
47
52
lock: true ,
48
53
);
49
54
}
50
55
51
56
public function clear (): void
52
57
{
53
- $ this ->filesystem ()->delete ($ this ->path );
58
+ $ this ->filesystem ()->delete ($ this ->path () );
54
59
}
55
60
56
61
/** @param callable(): DocumentAST $build */
57
62
public function fromCacheOrBuild (callable $ build ): DocumentAST
58
63
{
59
- if ($ this ->filesystem ()->exists ($ this ->path )) {
60
- $ ast = require $ this ->path ;
64
+ $ path = $ this ->path ();
65
+ if ($ this ->filesystem ()->exists ($ path )) {
66
+ $ ast = require $ path ;
61
67
if (! is_array ($ ast )) {
62
- throw new InvalidSchemaCacheContentsException ($ this -> path , $ ast );
68
+ throw new InvalidSchemaCacheContentsException ($ path , $ ast );
63
69
}
64
70
65
71
/** @var SerializableDocumentAST $ast */
You can’t perform that action at this time.
0 commit comments