Skip to content

Commit

Permalink
Merge pull request #181 from hevertonfreitas/php-8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cmfcmf authored Feb 19, 2022
2 parents 5a620de + ac8bcf8 commit 569d2fb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Cmfcmf/OpenWeatherMap/CurrentWeatherGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function __construct(\stdClass $json, $units)
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->position = 0;
Expand All @@ -63,6 +64,7 @@ public function rewind()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->currentWeathers[$this->position];
Expand All @@ -71,6 +73,7 @@ public function current()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->current()->city->id;
Expand All @@ -79,6 +82,7 @@ public function key()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function next()
{
++$this->position;
Expand All @@ -87,6 +91,7 @@ public function next()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function valid()
{
return isset($this->currentWeathers[$this->position]);
Expand Down
2 changes: 1 addition & 1 deletion Cmfcmf/OpenWeatherMap/Forecast.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function __construct(\SimpleXMLElement $xml, $units)
$this->clouds = new Unit($xml->clouds['all'], $xml->clouds['unit'], $xml->clouds['value']);
$this->precipitation = new Unit($xml->precipitation['value'], null, $xml->precipitation['type']);
$this->weather = new Weather($xml->symbol['number'], $xml->symbol['name'], $xml->symbol['var']);
$this->lastUpdate = new \DateTime($xml->lastupdate['value'], $utctz);
$this->lastUpdate = new \DateTime($xml->lastupdate['value'] ?? 'now', $utctz);

if (isset($xml['from'])) {
$this->time = new Time($xml['from'], $xml['to']);
Expand Down
1 change: 1 addition & 0 deletions Cmfcmf/OpenWeatherMap/Util/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ public function getFormatted()
*
* @return array
*/
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
return [
Expand Down
5 changes: 5 additions & 0 deletions Cmfcmf/OpenWeatherMap/WeatherForecast.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public function __construct($xml, $units, $days)
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function rewind()
{
$this->position = 0;
Expand All @@ -107,6 +108,7 @@ public function rewind()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function current()
{
return $this->forecasts[$this->position];
Expand All @@ -115,6 +117,7 @@ public function current()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function key()
{
return $this->position;
Expand All @@ -123,6 +126,7 @@ public function key()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function next()
{
++$this->position;
Expand All @@ -131,6 +135,7 @@ public function next()
/**
* @internal
*/
#[\ReturnTypeWillChange]
public function valid()
{
return isset($this->forecasts[$this->position]);
Expand Down

0 comments on commit 569d2fb

Please sign in to comment.