opentracing / opentracing-php

OpenTracing API for PHP
Apache License 2.0
505 stars 56 forks source link

Add compatibility with php8.1 #119

Closed viteksafronov closed 2 years ago

viteksafronov commented 2 years ago

Background

PHP 8.1 deprecates an ability to override internal methods with incompatible return types https://www.php.net/manual/en/migration81.incompatible.php#migration81.incompatible.core.type-compatibility-internal

Problem

Method OpenTracing\NoopSpanContext::getIterator() implements one from IteratorAggregate, which has a \Traversable as a return type, and so it will produce Deprecated notice.

Proposal

Add \Traversable as a return type