fix: add missing semicolon in generated cache file

The `require $cacheFilename` statement leads to a PHP error due to a missing semicolon in the generated cache file.
This commit is contained in:
Lea Rosema 2019-05-03 15:15:22 +02:00 committed by GitHub
parent 11d32d4568
commit 179944495e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -81,7 +81,7 @@ $cacheFilename = 'cached_schema.php';
if (!file_exists($cacheFilename)) {
$document = Parser::parse(file_get_contents('./schema.graphql'));
file_put_contents($cacheFilename, "<?php\nreturn " . var_export(AST::toArray($document), true));
file_put_contents($cacheFilename, "<?php\nreturn " . var_export(AST::toArray($document), true) . ";\n");
} else {
$document = AST::fromArray(require $cacheFilename); // fromArray() is a lazy operation as well
}