diff --git a/composer.json b/composer.json index 7571a903d..23310b7d4 100644 --- a/composer.json +++ b/composer.json @@ -50,6 +50,7 @@ "friendsofphp/php-cs-fixer": "^2.14", "influxdb/influxdb-php": "^1.15.0", "jonahgeorge/jaeger-client-php": "^0.4.4", + "league/plates": "^3.3", "malukenho/docheader": "^0.1.6", "mockery/mockery": "^1.0", "php-di/php-di": "^6.0", diff --git a/src/view/src/Engine/PlatesEngine.php b/src/view/src/Engine/PlatesEngine.php index dc0fcbb6e..bcc8dfc2d 100644 --- a/src/view/src/Engine/PlatesEngine.php +++ b/src/view/src/Engine/PlatesEngine.php @@ -16,10 +16,10 @@ use League\Plates\Engine; class PlatesEngine implements EngineInterface { - public function render($template, $data, $config): string - { - $plates = new Engine($config['view_path'], $config['file_extension'] ?? "php"); + public function render($template, $data, $config): string + { + $plates = new Engine($config['view_path'], $config['file_extension'] ?? 'php'); - return $plates->render($template, $data); - } -} \ No newline at end of file + return $plates->render($template, $data); + } +} diff --git a/src/view/tests/PlatesTest.php b/src/view/tests/PlatesTest.php index dd647bf8f..b6a8dc5a9 100644 --- a/src/view/tests/PlatesTest.php +++ b/src/view/tests/PlatesTest.php @@ -26,10 +26,10 @@ class PlatesTest extends TestCase $config = [ 'view_path' => __DIR__ . '/tpl', 'cache_path' => __DIR__ . '/runtime', - 'file_extension' => 'plates' + 'file_extension' => 'plates', ]; - $engine = new PlatesEngine(); + $engine = new PlatesEngine(); $res = $engine->render('index', ['name' => 'Hyperf'], $config); $this->assertEquals('