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>Vädret</title> |
||||
14 | </head> |
||||
15 | |||||
16 | <h1> Vädret </h1> |
||||
17 | <p>Här kan du få ut ditt nuvarande väder, prognos för de närmaste fem dagarna |
||||
18 | samt vädret för de fem föregående dagarna. |
||||
19 | <br>Du väljer själv om du vill ange din ip-adress eller lon/lat.</p> |
||||
20 | |||||
21 | <form method="POST" action="weather/validation"> |
||||
22 | <label> |
||||
23 | Ip-adress: |
||||
24 | </label> |
||||
25 | <input type="text" class="ipinput" name="ipinput"> |
||||
26 | </input> |
||||
27 | <br> |
||||
28 | <br> |
||||
29 | <legend><b>Eller</b></legend> |
||||
30 | <br> |
||||
31 | <label> |
||||
32 | Longitude: |
||||
33 | </label> |
||||
34 | <input type="text" name="lon"> |
||||
35 | </input> |
||||
36 | <label> |
||||
37 | Latitude: |
||||
38 | </label> |
||||
39 | <input type="text" name="lat"> |
||||
40 | </input> |
||||
41 | <br> |
||||
42 | <br> |
||||
43 | <input type="submit" class="submitbutton" value="Vädra!"></input> |
||||
44 | </form> |
||||
45 | <br> |
||||
46 | |||||
47 | <div> |
||||
48 | <h3>JSON-validering</h3> |
||||
49 | <p>Om du hellre vill se vädret som JSON går det också bra. |
||||
50 | <br> |
||||
51 | Antingen gör du det med din ip, eller lon/lat. |
||||
52 | <br> |
||||
53 | Detta gör du genom att skicka en GET-request, likt följande exempel: </p> |
||||
54 | <p><i> GET /weather-json?ip=216.58.211.142</i></p> |
||||
55 | <p><i> GET /weather-json?lon=17.79&lat=5.69</i></p> |
||||
56 | <pre> |
||||
57 | { |
||||
58 | "ip": "216.58.211.142", |
||||
59 | "ip4": "true" |
||||
60 | "ip6": "false" |
||||
61 | "host": "arn09s10-in-f14.1e100.net" |
||||
62 | } |
||||
63 | </pre> |
||||
64 | </div> |
||||
65 | |||||
66 | <div> |
||||
67 | <h3>Testroutes</h3> |
||||
68 | <p>Här nedan kan du testa routes för JSON-valideringen</p> |
||||
69 | <form action=<?= url("weather-json")?>> |
||||
70 | <br> |
||||
71 | <input type="hidden" name="ip" value="216.58.211.142"> |
||||
72 | <input type="submit" class="JSONbutton right" value="Fungerande"> |
||||
73 | </form> |
||||
74 | <form action=<?= url("weather-json")?>> |
||||
75 | <br> |
||||
76 | <input type="hidden" name="ip" value="216.58.21"> |
||||
77 | <input type="submit" class="JSONbutton wrong" value="Felaktig"> |
||||
78 | </form> |
||||
79 | <br> |
||||
80 | <form action=<?= url("weather-json")?>> |
||||
81 | <label>Du kan även testa vädret genom att skriva in en egen ip:</label> |
||||
82 | <br> |
||||
83 | <input type="text" name="ip"> |
||||
84 | <br> |
||||
85 | <br> |
||||
86 | <input type="submit" class="JSONbutton" value="Validera"> |
||||
87 | </form> |
||||
88 | </div> |
||||
89 | |||||
90 | <!-- <pre> |
||||
91 | <?= var_dump($data["defaultIp"]); ?> --> |
||||
0 ignored issues
–
show
Are you sure
var_dump($data['defaultIp']) 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
![]() |
|||||
92 |
This check looks for function or method calls that always return null and whose return value is used.
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.