From 9f7416e32bd00cf0398a146a6eb00769ca858523 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 9 Dec 2016 22:51:40 +0100 Subject: [PATCH] use php 7.1 list syntax --- app/Controllers/Forum/ForumController.php | 13 ++++++------- app/Net.php | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/app/Controllers/Forum/ForumController.php b/app/Controllers/Forum/ForumController.php index f840f0c..e205953 100644 --- a/app/Controllers/Forum/ForumController.php +++ b/app/Controllers/Forum/ForumController.php @@ -38,9 +38,8 @@ class ForumController extends Controller ->get(['topic_id']); $activeTopics = []; - // make this not disgusting - while (list($_n, $_t) = each($activeTopicsIds)) { - $topic = new Topic($_t->topic_id); + while ([$count, $row] = each($activeTopicsIds)) { + $topic = new Topic($row->topic_id); $forum = new Forum($topic->forum); // Check if we have permission to view it @@ -48,7 +47,7 @@ class ForumController extends Controller $fetch = DB::table('posts') ->groupBy('topic_id') ->orderByRaw('COUNT(*) DESC') - ->skip(11 + $_n) + ->skip(11 + $count) ->take(1) ->get(['topic_id']); @@ -69,15 +68,15 @@ class ForumController extends Controller ->get(['post_id']); $latestPosts = []; - while (list($_n, $_p) = each($latestPostsIds)) { - $post = new Post($_p->post_id); + while ([$count, $row] = each($latestPostsIds)) { + $post = new Post($row->post_id); $forum = new Forum($post->forum); // Check if we have permission to view it if (!$forum->perms->view) { $fetch = DB::table('posts') ->orderBy('post_id', 'desc') - ->skip(11 + $_n) + ->skip(11 + $count) ->take(1) ->get(['post_id']); diff --git a/app/Net.php b/app/Net.php index 6e4584f..fe647a1 100644 --- a/app/Net.php +++ b/app/Net.php @@ -103,7 +103,7 @@ class Net public static function matchCIDR(string $ip, string $range): bool { // Break the range up in parts - list($net, $mask) = explode('/', $range); + [$net, $mask] = explode('/', $range); // Check IP version $ipv = self::detectIPVersion($ip);