From 21dd4a72a470b5d1233d0ab10aef16fc79d85e35 Mon Sep 17 00:00:00 2001 From: Arul Date: Wed, 10 Jun 2020 10:52:53 +0800 Subject: [PATCH] Fixes use of deprecated function `each` the function `each` is deprecated since PHP 7.2 This pull request fixes that by replacing `each` with `current` and `next` --- src/UseStatements.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/UseStatements.php b/src/UseStatements.php index e22030d..ce8b8ef 100644 --- a/src/UseStatements.php +++ b/src/UseStatements.php @@ -95,7 +95,8 @@ public static function parseUseStatements($code, $forClass = NULL) $namespace = $class = $classLevel = $level = NULL; $res = $uses = []; - while (list(, $token) = each($tokens)) { + while ($token = current($tokens)) { + next($tokens); switch (is_array($token) ? $token[0] : $token) { case T_NAMESPACE: $namespace = ltrim(self::fetch($tokens, [T_STRING, T_NS_SEPARATOR]) . '\\', '\\');