diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-09-13 21:44:30 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-09-13 21:44:30 +0200 |
commit | 11932a471b4ef10faf76b6fcfe30a35f946eb7ab (patch) | |
tree | cde92c5eceef8991033fe7773ab60da51e289af4 /src/ste/Scope.php | |
parent | d7d74d0a714f29515da85078cc826ba49d2913b9 (diff) | |
download | ste-11932a471b4ef10faf76b6fcfe30a35f946eb7ab.tar.gz ste-11932a471b4ef10faf76b6fcfe30a35f946eb7ab.tar.bz2 ste-11932a471b4ef10faf76b6fcfe30a35f946eb7ab.zip |
Use short array syntax
We can use it now that we switched to PHP 7.3
Diffstat (limited to 'src/ste/Scope.php')
-rw-r--r-- | src/ste/Scope.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ste/Scope.php b/src/ste/Scope.php index 15d7d6c..ea71634 100644 --- a/src/ste/Scope.php +++ b/src/ste/Scope.php @@ -8,7 +8,7 @@ class Scope implements \ArrayAccess private $parent = null; /** @var array */ - public $vars = array(); + public $vars = []; /** * @param string $name @@ -18,7 +18,7 @@ class Scope implements \ArrayAccess private static function parse_name($name) { $remain = $name; - $fields = array(); + $fields = []; while ($remain !== "") { $br_open = strpos($remain, '['); @@ -96,7 +96,7 @@ class Scope implements \ArrayAccess $ref = &$this->get_topvar_reference($first, $localonly); } catch (VarNotInScope $e) { if ($create_if_not_exist) { - $this->vars[$first] = (count($fields) > 0) ? array() : ""; + $this->vars[$first] = (count($fields) > 0) ? [] : ""; $ref = &$this->vars[$first]; } else { return $nullref; @@ -116,7 +116,7 @@ class Scope implements \ArrayAccess } if ($i < count($fields) - 1) { - $ref[$field] = array(); + $ref[$field] = []; } else { $ref[$field] = ""; } |