Skip to content

Commit

Permalink
Merge pull request #180 from BenMorel/php81
Browse files Browse the repository at this point in the history
Compatibility with PHP 8.1
  • Loading branch information
kylekatarnls authored Nov 25, 2021
2 parents cbd5883 + c4db9e3 commit e8d3417
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/OpeningHoursForDay.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ public function openingHoursFilter(array $filters, bool $reverse = false)
foreach (($reverse ? array_reverse($this->openingHours) : $this->openingHours) as $timeRange) {
foreach ($filters as $filter) {
if ($result = $filter($timeRange)) {
reset($timeRange);

return $result;
}
}
Expand Down Expand Up @@ -216,16 +214,19 @@ public function offsetExists($offset): bool
return isset($this->openingHours[$offset]);
}

#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->openingHours[$offset];
}

#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
throw NonMutableOffsets::forClass(static::class);
}

#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->openingHours[$offset]);
Expand All @@ -236,7 +237,7 @@ public function count(): int
return count($this->openingHours);
}

public function getIterator()
public function getIterator(): ArrayIterator
{
return new ArrayIterator($this->openingHours);
}
Expand Down

0 comments on commit e8d3417

Please sign in to comment.