Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Commit

Permalink
Fix PhpStan.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Apr 11, 2022
1 parent 55b7e7d commit 25279c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ MJML PHP server

Imagine you want render your [MJML template](https://mjml.io) on your private PHP server, now you can.

> **Please note:** This package is not officially supported as of 2021-04-01. Install MJML manually on the server, or use Docker.
How to install
--------------

Expand Down
5 changes: 3 additions & 2 deletions src/MjmlServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ public function run(): void
echo json_encode([
'status' => 'ok',
'content' => (new self)->process($_POST['template'] ?? ''),
]);
], JSON_THROW_ON_ERROR);
} catch (\Throwable $e) {
echo json_encode([
'status' => 'error',
'message' => $e->getMessage(),
]);
], JSON_THROW_ON_ERROR);
}
die;
}
Expand All @@ -53,6 +53,7 @@ public function process(string $template): string
throw new \RuntimeException('Function shell_exec() is disabled on this server.');
}

/** @phpstan-ignore-next-line */
shell_exec('/node_modules/.bin/mjml ' . escapeshellarg($sourceFile) . ' > ' . escapeshellarg($finalFile));

return $this->processReturn($finalFile);
Expand Down

0 comments on commit 25279c6

Please sign in to comment.