Skip to content

Commit

Permalink
Fixes use of deprecated function each
Browse files Browse the repository at this point in the history
the function `each` is deprecated since PHP 7.2  This pull request fixes that by replacing `each` with `current` and `next`
  • Loading branch information
Arul- committed Jun 10, 2020
1 parent 2754bde commit 21dd4a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/UseStatements.php
Expand Up @@ -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]) . '\\', '\\');
Expand Down

0 comments on commit 21dd4a7

Please sign in to comment.