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 --- example/index.php | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'example') diff --git a/example/index.php b/example/index.php index bd03a43..4a96410 100644 --- a/example/index.php +++ b/example/index.php @@ -14,29 +14,31 @@ $ste = new ste\STECore( ); # Set STE to a more verbose behavior: -$ste->mute_runtime_errors = False; +$ste->mute_runtime_errors = false; # First, lets define some custom tags. # will exchange all letters with their uppercase complement -$ste->register_tag("uppercase", - function($ste, $params, $sub) - { +$ste->register_tag( + "uppercase", + function ($ste, $params, $sub) { $text = $sub($ste); # Get the tags content return strtoupper($text); # Return the new text. } ); # will repeat its content n times ( could be used too, but i needed more examples :-P ) -$ste->register_tag("repeat", - function($ste, $params, $sub) - { +$ste->register_tag( + "repeat", + function ($ste, $params, $sub) { $output = ""; - if(!is_numeric($params["n"])) + if (!is_numeric($params["n"])) { throw new ste\RuntimeError("Sorry, but parameter n must be a number..."); + } - for($i = 0; $i < $params["n"]; ++$i) + for ($i = 0; $i < $params["n"]; ++$i) { $output .= $sub($ste); + } return $output; } -- cgit v1.2.3-70-g09d2