Skip to content

Commit ecb4501

Browse files
committed
chore: Fix deprecation warnings for PHP 8.4 (fixes #195)
1 parent d3a51c3 commit ecb4501

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

Cmfcmf/OpenWeatherMap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,12 @@ private function buildUrl($query, $units, $lang, $appid, $mode, $url)
635635
* @param float $lat The location's latitude.
636636
* @param float $lon The location's longitude.
637637
* @param int $cnt Number of returned days.
638-
* @param \DateTime $start Starting point of time period.
639-
* @param \DateTime $end Final point of time period.
638+
* @param \DateTime|null $start Starting point of time period.
639+
* @param \DateTime|null $end Final point of time period.
640640
*
641641
* @return string
642642
*/
643-
private function buildUVIndexUrl($mode, $lat, $lon, $cnt = null, \DateTime $start = null, \DateTime $end = null)
643+
private function buildUVIndexUrl($mode, $lat, $lon, $cnt = null, ?\DateTime $start = null, ?\DateTime $end = null)
644644
{
645645
$params = array(
646646
'appid' => $this->apiKey,

Cmfcmf/OpenWeatherMap/Util/Temperature.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ class Temperature
4242
* @var Unit The day temperature. Might not be null.
4343
*/
4444
public $day;
45-
45+
4646
/**
4747
* @var Unit The morning temperature. Might not be null.
4848
*/
4949
public $morning;
50-
50+
5151
/**
5252
* @var Unit The evening temperature. Might not be null.
5353
*/
5454
public $evening;
55-
55+
5656
/**
5757
* @var Unit The night temperature. Might not be null.
5858
*/
@@ -111,17 +111,17 @@ public function getFormatted()
111111
/**
112112
* Create a new temperature object.
113113
*
114-
* @param Unit $now The current temperature.
115-
* @param Unit $min The minimal temperature.
116-
* @param Unit $max The maximal temperature.
117-
* @param Unit $day The day temperature. Might not be null.
118-
* @param Unit $morning The morning temperature. Might not be null.
119-
* @param Unit $evening The evening temperature. Might not be null.
120-
* @param Unit $night The night temperature. Might not be null.
114+
* @param Unit $now The current temperature.
115+
* @param Unit $min The minimal temperature.
116+
* @param Unit $max The maximal temperature.
117+
* @param Unit|null $day The day temperature. Might not be null.
118+
* @param Unit|null $morning The morning temperature. Might not be null.
119+
* @param Unit|null $evening The evening temperature. Might not be null.
120+
* @param Unit|null $night The night temperature. Might not be null.
121121
*
122122
* @internal
123123
*/
124-
public function __construct(Unit $now, Unit $min, Unit $max, Unit $day = null, Unit $morning = null, Unit $evening = null, Unit $night = null)
124+
public function __construct(Unit $now, Unit $min, Unit $max, ?Unit $day = null, ?Unit $morning = null, ?Unit $evening = null, ?Unit $night = null)
125125
{
126126
$this->now = $now;
127127
$this->min = $min;

Cmfcmf/OpenWeatherMap/Util/Wind.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ class Wind
3636
/**
3737
* Create a new wind object.
3838
*
39-
* @param Unit $speed The wind speed.
40-
* @param Unit $direction The wind direction.
39+
* @param Unit $speed The wind speed.
40+
* @param Unit|null $direction The wind direction.
4141
*
4242
* @internal
4343
*/
44-
public function __construct(Unit $speed, Unit $direction = null)
44+
public function __construct(Unit $speed, ?Unit $direction = null)
4545
{
4646
$this->speed = $speed;
4747
$this->direction = $direction;

0 commit comments

Comments
 (0)