mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-01 19:27:39 +08:00
Format code.
This commit is contained in:
parent
346d48c7c3
commit
3b8b23dddc
@ -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",
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user