-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe your environment
- PHP 8.3.21 (cli) (built: May 6 2025 13:58:10) (NTS)
- PHPStan - PHP Static Analysis Tool 2.1.16
open-telemetry/sdk1.4.0open-telemetry/exporter-otlp1.3.0
Steps to reproduce
- Create a new PsrTransport using
PsrTransportFactory->create(), then pass that to a new OTLP exporter (any one). E.g.,
$transport = (new PsrTransportFactory())->create('http://localhost:4318/v1/traces', 'application/json');
$exporter = new SpanExporter($transport);Then run PHPStan.
What is the expected behavior?
PHPStan passes with no errors.
What is the actual behavior?
PHPStan returns with the error:
Parameter #1 $transport of class OpenTelemetry\Contrib\Otlp\SpanExporter constructor expects OpenTelemetry\SDK\Common\Export\TransportInterface<'application/json'|'application/x-ndjson'|'application/x…'>, OpenTelemetry\SDK\Common\Export\Http\PsrTransport given. 🪪 argument.type
Additional context
I believe this just needs to be updated to TransportInterface:
| ): PsrTransport { |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working