use php 7.1 list syntax

This commit is contained in:
Pachira 2016-12-09 22:51:40 +01:00
parent c3a80ca7f9
commit 9f7416e32b
2 changed files with 7 additions and 8 deletions

View file

@ -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']);

View file

@ -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);