Issues (11)

view/weather/weather-result.php (1 issue)

Labels
Severity
1
<?php
2
namespace Anax\View;
3
4
?>
5
6
7
<h1>Kommande 7 Dagar</h1>
8
<?php if ($list) :
9
    echo "<table id='weather-table'>
10
11
    <tr>
12
13
    <th>Day</th>
14
15
    <th>Main Weather</th>
16
17
    <th>Temperature</th>
18
19
    <th>What it feels like</th>
20
21
    <th>Icon</th>
22
23
    </tr>";
24
25
    ?>
26
27
    <?php foreach ($list as $key => $row) :
28
        ?>
29
        <?php
30
        echo "<tr>";
31
        echo "<td>" .json_encode($key + 1). "</td>";
32
        echo "<td>" . trim(json_encode($row["weather"][0]["main"]), '"') . "</td>";
33
        echo "<td>" . round(json_encode($row["main"]["temp"]-273.15), 1). " C°" . "</td>";
0 ignored issues
show
json_encode($row['main']['temp'] - 273.15) of type string is incompatible with the type double expected by parameter $val of round(). ( Ignorable by Annotation )

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

33
        echo "<td>" . round(/** @scrutinizer ignore-type */ json_encode($row["main"]["temp"]-273.15), 1). " C°" . "</td>";
Loading history...
34
        echo "<td>" . round(json_encode($row["main"]["feels_like"]-273.15), 1) . "</td>";
35
        echo "<td><img src=\"http://openweathermap.org/img/wn/" . trim(json_encode($row["weather"][0]["icon"]), '"') . "@2x.png\"></td>";
36
    endforeach;
37
    echo "</tr>";
38
    echo "</table>";
39
    ?>
40
<?php endif; ?>
41