File tree 1 file changed +3
-5
lines changed
1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,6 @@ public function compile(
41
41
42
42
$ fqcn = (string ) ($ class = ($ context ->getClass () ?? new ClassReferenceMetadata ($ className , $ namespace )));
43
43
44
- if ($ context ->getFilePath () !== null && file_exists ($ context ->getFilePath ())) {
45
- include_once $ context ->getFilePath ();
46
- }
47
-
48
44
$ tree = $ this ->strategy ->buildTree (
49
45
$ context ->getPropertyPath (),
50
46
$ class ,
@@ -54,7 +50,9 @@ public function compile(
54
50
$ prettyPrinter = new PrettyPrinter \Standard ();
55
51
if ($ context ->getFilePath () !== null && is_writable (dirname ($ context ->getFilePath ()))) {
56
52
file_put_contents ($ context ->getFilePath (), $ prettyPrinter ->prettyPrintFile ($ tree ));
57
- include_once $ context ->getFilePath ();
53
+ if (!class_exists ($ fqcn )) {
54
+ include_once $ context ->getFilePath ();
55
+ }
58
56
} else {
59
57
include_once 'data://text/plain;base64, ' . base64_encode ($ prettyPrinter ->prettyPrintFile ($ tree ));
60
58
}
You can’t perform that action at this time.
0 commit comments