Format code.

This commit is contained in:
李铭昕 2019-11-13 10:47:16 +08:00
parent 346d48c7c3
commit 3b8b23dddc
3 changed files with 9 additions and 8 deletions

View File

@ -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",

View File

@ -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);
}
}
return $plates->render($template, $data);
}
}

View File

@ -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('<!DOCTYPE html>