Skip to content

Commit e09a998

Browse files
committed
cleanup
1 parent 9efbeed commit e09a998

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

public/example.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
$data['latitude'] = isset($_GET['lat']) ? $_GET['lat'] : '';
2828
$data['longitude'] = isset($_GET['long']) ? $_GET['long'] : '';
2929

30-
$selected = ' checked';
31-
$data['call_forecast'] = ($data['call'] == 'forecast') ? $selected : '';
32-
$data['call_current'] = ($data['call'] == 'current') ? $selected : '';
33-
$data['call_usage'] = ($data['call'] == 'usage') ? $selected : '';
34-
$data['units_M'] = ($data['units'] == 'M') ? $selected : '';
35-
$data['units_I'] = ($data['units'] == 'I') ? $selected : '';
36-
$data['units_S'] = ($data['units'] == 'S') ? $selected : '';
30+
$check = ' checked';
31+
$data['call_forecast'] = ($data['call'] == 'forecast') ? $check : '';
32+
$data['call_current'] = ($data['call'] == 'current') ? $check : '';
33+
$data['call_usage'] = ($data['call'] == 'usage') ? $check : '';
34+
$data['units_M'] = ($data['units'] == 'M') ? $check : '';
35+
$data['units_I'] = ($data['units'] == 'I') ? $check : '';
36+
$data['units_S'] = ($data['units'] == 'S') ? $check : '';
3737

3838
$data['pageTitle'] = 'weatherbit-api-wrapper v' . Weatherbit::VERSION;
3939

@@ -63,9 +63,9 @@
6363

6464
if (!empty($data['city'])) {
6565
$weatherbit->setLocationByCity($data['city'], $data['country']);
66-
} elseif (!empty($latitude)) {
66+
} elseif (!empty($data['latitude'])) {
6767
$weatherbit->setLocationByLatitudeLongitude($data['latitude'], $data['longitude']);
68-
} elseif (!empty($ipAddress)) {
68+
} elseif (!empty($data['ipAddress'])) {
6969
$weatherbit->setLocationByIP($data['ipAddress']);
7070
}
7171

@@ -151,7 +151,7 @@ function printForm()
151151
Units:
152152
<input type="radio" name="units" value="M"' . $data['units_M'] . '>M - Metric (Celcius, m/s, mm)</input>
153153
&nbsp;
154-
<input type="radio" name="units" value="I"' . $data['units_I'] . '>I - Imperial Fahrenheit (F, mph, in)</input>
154+
<input type="radio" name="units" value="I"' . $data['units_I'] . '>I - Imperial (Fahrenheit, mph, in)</input>
155155
&nbsp;
156156
<input type="radio" name="units" value="S"' . $data['units_S'] . '>S - Scientific (Kelvin, m/s, mm)</input>
157157
</select>

src/Weatherbit.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class Weatherbit
7777
* @var string - Units for API Response
7878
* M = [DEFAULT] Metric (Celcius, m/s, mm)
7979
* S = Scientific (Kelvin, m/s, mm)
80-
* I = Imperial Fahrenheit (F, mph, in)
80+
* I = Imperial (Fahrenheit, mph, in)
8181
* @see https://www.weatherbit.io/api/requests
8282
*/
8383
private $units = '';

0 commit comments

Comments
 (0)