Issues (55)

view/home/home.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Anax\View;
4
5
$questions = isset($questions) ? $questions : null;
6
$users = isset($users) ? $users : null;
7
$tags = isset($tags) ? $tags : null;
8
9
?>
10
11
<h1>Mechanical Heaven</h1>
12
13
<h2>Most recent topics</h2>
14
<?php foreach ($questions as $q) : ?>
15
    <p><?= $q ?></p>
16
<?php endforeach; ?>
17
18
<h2>Most active users</h2>
19
<?php foreach (array_keys($users) as $u) : ?>
0 ignored issues
show
It seems like $users can also be of type null; however, parameter $array of array_keys() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

19
<?php foreach (array_keys(/** @scrutinizer ignore-type */ $users) as $u) : ?>
Loading history...
20
    <p><?= $u ?></p>
21
<?php endforeach; ?>
22
23
<h2>Most popular tags</h2>
24
<?php foreach (array_keys($tags) as $t) : ?>
25
    <p><?= $t ?></p>
26
<?php endforeach; ?>
27