Skip to content

Commit 569d2fb

Browse files
authored
Merge pull request #181 from hevertonfreitas/php-8.1
2 parents 5a620de + ac8bcf8 commit 569d2fb

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

Cmfcmf/OpenWeatherMap/CurrentWeatherGroup.php

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function __construct(\stdClass $json, $units)
5555
/**
5656
* @internal
5757
*/
58+
#[\ReturnTypeWillChange]
5859
public function rewind()
5960
{
6061
$this->position = 0;
@@ -63,6 +64,7 @@ public function rewind()
6364
/**
6465
* @internal
6566
*/
67+
#[\ReturnTypeWillChange]
6668
public function current()
6769
{
6870
return $this->currentWeathers[$this->position];
@@ -71,6 +73,7 @@ public function current()
7173
/**
7274
* @internal
7375
*/
76+
#[\ReturnTypeWillChange]
7477
public function key()
7578
{
7679
return $this->current()->city->id;
@@ -79,6 +82,7 @@ public function key()
7982
/**
8083
* @internal
8184
*/
85+
#[\ReturnTypeWillChange]
8286
public function next()
8387
{
8488
++$this->position;
@@ -87,6 +91,7 @@ public function next()
8791
/**
8892
* @internal
8993
*/
94+
#[\ReturnTypeWillChange]
9095
public function valid()
9196
{
9297
return isset($this->currentWeathers[$this->position]);

Cmfcmf/OpenWeatherMap/Forecast.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function __construct(\SimpleXMLElement $xml, $units)
8080
$this->clouds = new Unit($xml->clouds['all'], $xml->clouds['unit'], $xml->clouds['value']);
8181
$this->precipitation = new Unit($xml->precipitation['value'], null, $xml->precipitation['type']);
8282
$this->weather = new Weather($xml->symbol['number'], $xml->symbol['name'], $xml->symbol['var']);
83-
$this->lastUpdate = new \DateTime($xml->lastupdate['value'], $utctz);
83+
$this->lastUpdate = new \DateTime($xml->lastupdate['value'] ?? 'now', $utctz);
8484

8585
if (isset($xml['from'])) {
8686
$this->time = new Time($xml['from'], $xml['to']);

Cmfcmf/OpenWeatherMap/Util/Unit.php

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ public function getFormatted()
152152
*
153153
* @return array
154154
*/
155+
#[\ReturnTypeWillChange]
155156
public function jsonSerialize()
156157
{
157158
return [

Cmfcmf/OpenWeatherMap/WeatherForecast.php

+5
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public function __construct($xml, $units, $days)
9999
/**
100100
* @internal
101101
*/
102+
#[\ReturnTypeWillChange]
102103
public function rewind()
103104
{
104105
$this->position = 0;
@@ -107,6 +108,7 @@ public function rewind()
107108
/**
108109
* @internal
109110
*/
111+
#[\ReturnTypeWillChange]
110112
public function current()
111113
{
112114
return $this->forecasts[$this->position];
@@ -115,6 +117,7 @@ public function current()
115117
/**
116118
* @internal
117119
*/
120+
#[\ReturnTypeWillChange]
118121
public function key()
119122
{
120123
return $this->position;
@@ -123,6 +126,7 @@ public function key()
123126
/**
124127
* @internal
125128
*/
129+
#[\ReturnTypeWillChange]
126130
public function next()
127131
{
128132
++$this->position;
@@ -131,6 +135,7 @@ public function next()
131135
/**
132136
* @internal
133137
*/
138+
#[\ReturnTypeWillChange]
134139
public function valid()
135140
{
136141
return isset($this->forecasts[$this->position]);

0 commit comments

Comments
 (0)