Issues (34)

view/ip/validation.php (2 issues)

Labels
Severity
1
<?php
2
3
namespace Anax\View;
4
5
/**
6
 * Render content within an article.
7
 */
8
9
?>
10
<head>
11
    <meta charset="utf-8">
12
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
13
    <title>IP</title>
14
</head>
15
16
<h1> Resultat </h1>
17
18
<p>Resultat för adress <i> <?= $data["ip"] ?></i></p>
19
<p>Godkänd Ip4: <?php
20
if ($data["ip4"]) {
21
    echo "<b>ja</b>";
22
} else {
23
    echo "<b>nej</b>";
24
}
25
?>
26
</p>
27
<p>Godkänd Ip6: <?php
28
if ($data["ip6"]) {
29
    echo "<b>ja</b>";
30
} else {
31
    echo "<b>nej</b>";
32
}
33
?>
34
</p>
35
<?php
36
if ($data["geoInfo"] == "Inget att visa") {
37
    echo "Domänen för adressen är " . $data["hostname"] ;
38
    echo "<br>Ingen tillgänglig plats";
39
} elseif ($data["hostname"] != "Ej korrekt ip") {
40
    echo "Domänen för adressen är " . $data["hostname"] ;
41
    echo "<br><br>Addressen befinner sig i " . $data["geoInfo"]["city"] . ", " .
42
         $data["geoInfo"]["country"];
43
    echo "<br>Koordinaterna är <br><b>latitude:</b> " .  $data["geoInfo"]["latitude"] .
44
         "<br><b>longitude</b>: " . $data["geoInfo"]["longitude"];
45
} else {
46
    echo "Ingen tillgänglig domän";
47
    echo "<br>Ingen tillgänglig plats";
48
}
49
?>
50
51
52
<!-- <pre>
53
<?= var_dump($data); ?> -->
0 ignored issues
show
Are you sure the usage of var_dump($data) is correct as it seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
Are you sure var_dump($data) of type void can be used in echo? ( Ignorable by Annotation )

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

53
<?= /** @scrutinizer ignore-type */ var_dump($data); ?> -->
Loading history...
54