From 11932a471b4ef10faf76b6fcfe30a35f946eb7ab Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Sun, 13 Sep 2020 21:44:30 +0200 Subject: Use short array syntax We can use it now that we switched to PHP 7.3 --- tests/functional/test_array/Test.php | 12 ++++++------ tests/functional/test_foreach/Test.php | 10 +++++----- tests/functional/test_short_for_additional_attribs/Test.php | 10 +++++----- tests/functional/test_static_numeric_array_access/Test.php | 4 ++-- tests/functional/test_tagname/Test.php | 4 ++-- .../functional/test_trailing_closing_array_bracket/Test.php | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/functional/test_array/Test.php b/tests/functional/test_array/Test.php index 58f0cb8..85d0217 100644 --- a/tests/functional/test_array/Test.php +++ b/tests/functional/test_array/Test.php @@ -14,14 +14,14 @@ class Test extends BaseTest protected function setUpSte(STECore $ste): void { - $ste->vars["foo"] = array( - "a" => array( + $ste->vars["foo"] = [ + "a" => [ "blabla" => "OK" - ), + ], "b" => "bla" - ); - $ste->vars["bar"] = array( + ]; + $ste->vars["bar"] = [ "baz" => "a" - ); + ]; } } diff --git a/tests/functional/test_foreach/Test.php b/tests/functional/test_foreach/Test.php index 3f8cc73..2fc3d91 100644 --- a/tests/functional/test_foreach/Test.php +++ b/tests/functional/test_foreach/Test.php @@ -14,10 +14,10 @@ class Test extends BaseTest protected function setUpSte(STECore $ste): void { - $ste->vars["foo"] = array( - "a" => array("a" => 100, "b" => 200), - "b" => array("a" => 1, "b" => 2), - "c" => array("a" => 42, "b" => 1337) - ); + $ste->vars["foo"] = [ + "a" => ["a" => 100, "b" => 200], + "b" => ["a" => 1, "b" => 2], + "c" => ["a" => 42, "b" => 1337] + ]; } } diff --git a/tests/functional/test_short_for_additional_attribs/Test.php b/tests/functional/test_short_for_additional_attribs/Test.php index 8099869..e0e0934 100644 --- a/tests/functional/test_short_for_additional_attribs/Test.php +++ b/tests/functional/test_short_for_additional_attribs/Test.php @@ -14,10 +14,10 @@ class Test extends BaseTest protected function setUpSte(STECore $ste): void { - $ste->set_var_by_name("data", array( - array('content' => 'foo', 'foo' => true), - array('content' => 'bar', 'foo' => false), - array('content' => 'baz', 'foo' => false), - )); + $ste->set_var_by_name("data", [ + ['content' => 'foo', 'foo' => true], + ['content' => 'bar', 'foo' => false], + ['content' => 'baz', 'foo' => false], + ]); } } diff --git a/tests/functional/test_static_numeric_array_access/Test.php b/tests/functional/test_static_numeric_array_access/Test.php index 0c6a853..150b74a 100644 --- a/tests/functional/test_static_numeric_array_access/Test.php +++ b/tests/functional/test_static_numeric_array_access/Test.php @@ -14,10 +14,10 @@ class Test extends BaseTest protected function setUpSte(STECore $ste): void { - $ste->set_var_by_name("foo", array( + $ste->set_var_by_name("foo", [ "foo", "bar", "baz", - )); + ]); } } diff --git a/tests/functional/test_tagname/Test.php b/tests/functional/test_tagname/Test.php index 8e3d8f6..38f26c2 100644 --- a/tests/functional/test_tagname/Test.php +++ b/tests/functional/test_tagname/Test.php @@ -14,12 +14,12 @@ class Test extends BaseTest protected function setUpSte(STECore $ste): void { - $names = array( + $names = [ "foo", "ab_cd", "foo123baz", "x0123", - ); + ]; foreach ($names as $name) { $ste->register_tag( diff --git a/tests/functional/test_trailing_closing_array_bracket/Test.php b/tests/functional/test_trailing_closing_array_bracket/Test.php index 9e6ff2c..a24f93c 100644 --- a/tests/functional/test_trailing_closing_array_bracket/Test.php +++ b/tests/functional/test_trailing_closing_array_bracket/Test.php @@ -14,10 +14,10 @@ class Test extends BaseTest protected function setUpSte(STECore $ste): void { - $ste->set_var_by_name("foo", array( + $ste->set_var_by_name("foo", [ "foo", "bar", "baz", - )); + ]); } } -- cgit v1.2.3-70-g09d2