Skip to content

Commit

Permalink
Merge pull request #45 from franmomu/deprecations_php81
Browse files Browse the repository at this point in the history
Avoid deprecations using php 8.1
  • Loading branch information
dannyvankooten authored Nov 15, 2021
2 parents bccb0a1 + fc0413d commit 59831d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Countries.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ public function isCountryCodeInEU(string $code) : bool
* @return mixed Can return any type.
* @since 5.0.0
*/
#[\ReturnTypeWillChange]
public function current()
{
return current($this->data);
Expand All @@ -307,6 +308,7 @@ public function current()
* @return void Any returned value is ignored.
* @since 5.0.0
*/
#[\ReturnTypeWillChange]
public function next()
{
next($this->data);
Expand All @@ -318,6 +320,7 @@ public function next()
* @return mixed scalar on success, or null on failure.
* @since 5.0.0
*/
#[\ReturnTypeWillChange]
public function key()
{
return key($this->data);
Expand All @@ -330,6 +333,7 @@ public function key()
* Returns true on success or false on failure.
* @since 5.0.0
*/
#[\ReturnTypeWillChange]
public function valid()
{
return key($this->data) !== null;
Expand All @@ -341,6 +345,7 @@ public function valid()
* @return void Any returned value is ignored.
* @since 5.0.0
*/
#[\ReturnTypeWillChange]
public function rewind()
{
reset($this->data);
Expand All @@ -350,6 +355,7 @@ public function rewind()
* @param string $countryCode
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($countryCode)
{
return isset($this->data[$countryCode]);
Expand All @@ -360,6 +366,7 @@ public function offsetExists($countryCode)
* @return string
* @throws \Exception
*/
#[\ReturnTypeWillChange]
public function offsetGet($countryCode)
{
if (!$this->offsetExists($countryCode)) {
Expand All @@ -375,6 +382,7 @@ public function offsetGet($countryCode)
* @return string
* @throws \Exception
*/
#[\ReturnTypeWillChange]
public function offsetSet($countryCode, $name)
{
throw new Exception('Invalid use of Countries class');
Expand All @@ -385,6 +393,7 @@ public function offsetSet($countryCode, $name)
* @return string
* @throws \Exception
*/
#[\ReturnTypeWillChange]
public function offsetUnset($countryCode)
{
throw new Exception('Invalid use of Countries class');
Expand Down

0 comments on commit 59831d6

Please sign in to comment.