Skip to content

Commit 59831d6

Browse files
Merge pull request #45 from franmomu/deprecations_php81
Avoid deprecations using php 8.1
2 parents bccb0a1 + fc0413d commit 59831d6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Countries.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ public function isCountryCodeInEU(string $code) : bool
296296
* @return mixed Can return any type.
297297
* @since 5.0.0
298298
*/
299+
#[\ReturnTypeWillChange]
299300
public function current()
300301
{
301302
return current($this->data);
@@ -307,6 +308,7 @@ public function current()
307308
* @return void Any returned value is ignored.
308309
* @since 5.0.0
309310
*/
311+
#[\ReturnTypeWillChange]
310312
public function next()
311313
{
312314
next($this->data);
@@ -318,6 +320,7 @@ public function next()
318320
* @return mixed scalar on success, or null on failure.
319321
* @since 5.0.0
320322
*/
323+
#[\ReturnTypeWillChange]
321324
public function key()
322325
{
323326
return key($this->data);
@@ -330,6 +333,7 @@ public function key()
330333
* Returns true on success or false on failure.
331334
* @since 5.0.0
332335
*/
336+
#[\ReturnTypeWillChange]
333337
public function valid()
334338
{
335339
return key($this->data) !== null;
@@ -341,6 +345,7 @@ public function valid()
341345
* @return void Any returned value is ignored.
342346
* @since 5.0.0
343347
*/
348+
#[\ReturnTypeWillChange]
344349
public function rewind()
345350
{
346351
reset($this->data);
@@ -350,6 +355,7 @@ public function rewind()
350355
* @param string $countryCode
351356
* @return bool
352357
*/
358+
#[\ReturnTypeWillChange]
353359
public function offsetExists($countryCode)
354360
{
355361
return isset($this->data[$countryCode]);
@@ -360,6 +366,7 @@ public function offsetExists($countryCode)
360366
* @return string
361367
* @throws \Exception
362368
*/
369+
#[\ReturnTypeWillChange]
363370
public function offsetGet($countryCode)
364371
{
365372
if (!$this->offsetExists($countryCode)) {
@@ -375,6 +382,7 @@ public function offsetGet($countryCode)
375382
* @return string
376383
* @throws \Exception
377384
*/
385+
#[\ReturnTypeWillChange]
378386
public function offsetSet($countryCode, $name)
379387
{
380388
throw new Exception('Invalid use of Countries class');
@@ -385,6 +393,7 @@ public function offsetSet($countryCode, $name)
385393
* @return string
386394
* @throws \Exception
387395
*/
396+
#[\ReturnTypeWillChange]
388397
public function offsetUnset($countryCode)
389398
{
390399
throw new Exception('Invalid use of Countries class');

0 commit comments

Comments
 (0)