Skip to content

Commit

Permalink
Merge pull request #2439 from kylekatarnls/fix/period-php-8-1
Browse files Browse the repository at this point in the history
Allow PHP 8.1 return types for Iterator
  • Loading branch information
kylekatarnls authored Sep 6, 2021
2 parents 95681e6 + 63d5c74 commit 875f62a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Carbon/CarbonPeriod.php
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,7 @@ public function setEndDate($date, $inclusive = null)
*
* @return bool
*/
#[ReturnTypeWillChange]
public function valid()
{
return $this->validateCurrentDate() === true;
Expand All @@ -1320,6 +1321,7 @@ public function valid()
*
* @return int|null
*/
#[ReturnTypeWillChange]
public function key()
{
return $this->valid()
Expand All @@ -1332,6 +1334,7 @@ public function key()
*
* @return CarbonInterface|null
*/
#[ReturnTypeWillChange]
public function current()
{
return $this->valid()
Expand All @@ -1346,6 +1349,7 @@ public function current()
*
* @return void
*/
#[ReturnTypeWillChange]
public function next()
{
if ($this->current === null) {
Expand All @@ -1372,6 +1376,7 @@ public function next()
*
* @return void
*/
#[ReturnTypeWillChange]
public function rewind()
{
$this->key = 0;
Expand Down

0 comments on commit 875f62a

Please sign in to comment.