remove: unused foreach keys

This commit is contained in:
HDVinnie
2023-06-19 10:18:48 -04:00
parent 2a3ee4a045
commit d3f3510011
5 changed files with 22 additions and 22 deletions
+11 -11
View File
@@ -159,7 +159,7 @@ class AutoBonAllocation extends Command
$array = [];
foreach ($dyingTorrent as $key => $value) {
foreach ($dyingTorrent as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 2;
} else {
@@ -167,7 +167,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($legendaryTorrent as $key => $value) {
foreach ($legendaryTorrent as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 1.5;
} else {
@@ -175,7 +175,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($oldTorrent as $key => $value) {
foreach ($oldTorrent as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 1;
} else {
@@ -183,7 +183,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($hugeTorrent as $key => $value) {
foreach ($hugeTorrent as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 0.75;
} else {
@@ -191,7 +191,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($largeTorrent as $key => $value) {
foreach ($largeTorrent as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 0.50;
} else {
@@ -199,7 +199,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($regularTorrent as $key => $value) {
foreach ($regularTorrent as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 0.25;
} else {
@@ -207,7 +207,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($participaintSeeder as $key => $value) {
foreach ($participaintSeeder as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 0.25;
} else {
@@ -215,7 +215,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($teamplayerSeeder as $key => $value) {
foreach ($teamplayerSeeder as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 0.50;
} else {
@@ -223,7 +223,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($commitedSeeder as $key => $value) {
foreach ($commitedSeeder as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 0.75;
} else {
@@ -231,7 +231,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($mvpSeeder as $key => $value) {
foreach ($mvpSeeder as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 1;
} else {
@@ -239,7 +239,7 @@ class AutoBonAllocation extends Command
}
}
foreach ($legendarySeeder as $key => $value) {
foreach ($legendarySeeder as $value) {
if (\array_key_exists($value->user_id, $array)) {
$array[$value->user_id] += $value->value * 2;
} else {
+2 -2
View File
@@ -50,7 +50,7 @@ class DemoSeed extends Command
$abort = false;
foreach ($this->movie_ids() as $key => $id) {
foreach ($this->movie_ids() as $id) {
// Users
$this->info('Creating User Account');
@@ -259,7 +259,7 @@ Menu
}
}
foreach ($this->tv_ids() as $key => $id) {
foreach ($this->tv_ids() as $id) {
// Users
$this->info('Creating User Account');
+2 -2
View File
@@ -92,7 +92,7 @@ class TorrentTools
{
$size = 0;
if (\array_key_exists('files', $decodedTorrent['info']) && (is_countable($decodedTorrent['info']['files']) ? \count($decodedTorrent['info']['files']) : 0)) {
foreach ($decodedTorrent['info']['files'] as $k => $file) {
foreach ($decodedTorrent['info']['files'] as $file) {
$dir = '';
$size += $file['length'];
$count = is_countable($file['path']) ? \count($file['path']) : 0;
@@ -143,7 +143,7 @@ class TorrentTools
$filenames = [];
if (\array_key_exists('files', $decodedTorrent['info']) && (is_countable($decodedTorrent['info']['files']) ? \count($decodedTorrent['info']['files']) : 0)) {
foreach ($decodedTorrent['info']['files'] as $k => $file) {
foreach ($decodedTorrent['info']['files'] as $file) {
$count = is_countable($file['path']) ? \count($file['path']) : 0;
for ($i = 0; $i < $count; $i++) {
if (! \in_array($file['path'][$i], $filenames)) {
+5 -5
View File
@@ -249,7 +249,7 @@ class ChatController extends Controller
}
$senderListening = false;
foreach ($senderEchoes as $se => $senderEcho) {
foreach ($senderEchoes as $senderEcho) {
if ($senderEcho['target_id'] == $receiverId) {
$senderListening = true;
}
@@ -265,7 +265,7 @@ class ChatController extends Controller
}
$receiverListening = false;
foreach ($receiverEchoes as $se => $receiverEcho) {
foreach ($receiverEchoes as $receiverEcho) {
if ($receiverEcho['target_id'] == $userId) {
$receiverListening = true;
}
@@ -305,7 +305,7 @@ class ChatController extends Controller
}
$senderListening = false;
foreach ($senderAudibles as $se => $senderEcho) {
foreach ($senderAudibles as $senderEcho) {
if ($senderEcho['target_id'] == $receiverId) {
$senderListening = true;
}
@@ -322,7 +322,7 @@ class ChatController extends Controller
}
$receiverListening = false;
foreach ($receiverAudibles as $se => $receiverEcho) {
foreach ($receiverAudibles as $receiverEcho) {
if ($receiverEcho['target_id'] == $userId) {
$receiverListening = true;
}
@@ -516,7 +516,7 @@ class ChatController extends Controller
}
$senderListening = false;
foreach ($senderEchoes as $se => $senderEcho) {
foreach ($senderEchoes as $senderEcho) {
if ($senderEcho['room_id'] == $room->id) {
$senderListening = true;
}
@@ -68,7 +68,7 @@ class ForumController extends Controller
);
// Permissions
foreach ($groups as $k => $group) {
foreach ($groups as $group) {
$perm = Permission::where('forum_id', '=', $forum->id)->where('group_id', '=', $group->id)->first();
if ($perm == null) {
$perm = new Permission();
@@ -127,7 +127,7 @@ class ForumController extends Controller
);
// Permissions
foreach ($groups as $k => $group) {
foreach ($groups as $group) {
$perm = Permission::where('forum_id', '=', $id)->where('group_id', '=', $group->id)->first();
if ($perm == null) {
$perm = new Permission();