From 3b8b23dddcb5b2f4b78b817a8273706ff6f11612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=93=AD=E6=98=95?= <715557344@qq.com> Date: Wed, 13 Nov 2019 10:47:16 +0800 Subject: [PATCH] Format code. --- composer.json | 1 + src/view/src/Engine/PlatesEngine.php | 12 ++++++------ src/view/tests/PlatesTest.php | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) 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('