From 2381c52c690342f773a7cfa500387b6bfad76952 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Thu, 30 Apr 2020 09:38:05 +0200 Subject: Automatic code formatting Also add git hooks that checks formatting --- tests/test.php | 11 +++++++---- tests/test_array/code.php | 3 ++- tests/test_blocks/code.php | 4 ++-- tests/test_closure/code.php | 4 ++-- tests/test_escapes/code.php | 5 +++-- tests/test_foreach/code.php | 3 ++- tests/test_getset/code.php | 3 ++- tests/test_loop/code.php | 4 ++-- tests/test_mktag/code.php | 4 ++-- tests/test_pseudotags/code.php | 4 ++-- tests/test_recursive/code.php | 3 ++- tests/test_scoping/code.php | 4 ++-- tests/test_short/code.php | 4 ++-- tests/test_simple/code.php | 3 ++- tests/test_tagname/code.php | 8 +++++--- 15 files changed, 39 insertions(+), 28 deletions(-) (limited to 'tests') diff --git a/tests/test.php b/tests/test.php index fcfac0e..15453b0 100644 --- a/tests/test.php +++ b/tests/test.php @@ -5,14 +5,17 @@ require("code.php"); use \kch42\ste; -class TestStorage implements ste\StorageAccess { - public function load($tpl, &$mode) { +class TestStorage implements ste\StorageAccess +{ + public function load($tpl, &$mode) + { $mode = ste\StorageAccess::MODE_SOURCE; return file_get_contents($tpl); } - public function save($tpl, $data, $mode) { - if($mode != ste\StorageAccess::MODE_TRANSCOMPILED) { + public function save($tpl, $data, $mode) + { + if ($mode != ste\StorageAccess::MODE_TRANSCOMPILED) { return; } diff --git a/tests/test_array/code.php b/tests/test_array/code.php index 1e02e20..b524c15 100644 --- a/tests/test_array/code.php +++ b/tests/test_array/code.php @@ -1,6 +1,7 @@ vars["foo"] = array( "a" => array( "blabla" => "OK" diff --git a/tests/test_blocks/code.php b/tests/test_blocks/code.php index 2e68d2d..25e7f00 100644 --- a/tests/test_blocks/code.php +++ b/tests/test_blocks/code.php @@ -1,5 +1,5 @@ register_tag("my_echo", function($ste, $params, $sub) { +function test_func($ste) +{ + $ste->register_tag("my_echo", function ($ste, $params, $sub) { return $params["text"]; }); } diff --git a/tests/test_foreach/code.php b/tests/test_foreach/code.php index 1dc5ab9..60ad311 100644 --- a/tests/test_foreach/code.php +++ b/tests/test_foreach/code.php @@ -1,6 +1,7 @@ vars["foo"] = array( "a" => array("a" => 100, "b" => 200), "b" => array("a" => 1, "b" => 2), diff --git a/tests/test_getset/code.php b/tests/test_getset/code.php index 398686b..722af1e 100644 --- a/tests/test_getset/code.php +++ b/tests/test_getset/code.php @@ -1,5 +1,6 @@ vars["foo"] = "bar"; } diff --git a/tests/test_loop/code.php b/tests/test_loop/code.php index 2e68d2d..25e7f00 100644 --- a/tests/test_loop/code.php +++ b/tests/test_loop/code.php @@ -1,5 +1,5 @@ mute_runtime_errors = false; } diff --git a/tests/test_scoping/code.php b/tests/test_scoping/code.php index 2e68d2d..25e7f00 100644 --- a/tests/test_scoping/code.php +++ b/tests/test_scoping/code.php @@ -1,5 +1,5 @@ vars["foo"] = "World"; } diff --git a/tests/test_tagname/code.php b/tests/test_tagname/code.php index 6001358..e934989 100644 --- a/tests/test_tagname/code.php +++ b/tests/test_tagname/code.php @@ -2,7 +2,8 @@ use kch42\ste\STECore; -function test_func(STECore $ste) { +function test_func(STECore $ste) +{ $names = array( "foo", "ab_cd", @@ -13,8 +14,9 @@ function test_func(STECore $ste) { foreach ($names as $name) { $ste->register_tag( $name, - function ($ste, $params, $sub) use ($name) { return $name; } + function ($ste, $params, $sub) use ($name) { + return $name; + } ); } - } -- cgit v1.2.3-54-g00ecf