Closed LauJosefsen closed 6 days ago
Looks to be the same as this report, in that we are using constructor property promotion and thus facing this complaint.
Ah sorry, I only searched through open issues, as I was sure this was a bug.
Does this mean it is a bug of phpstan and phpstorm to report this as an error?
@LauJosefsen I think we could leave this open and test adding the additional target parameter to see if we can make phpstan happy 👍
I almost created another ticket with a Psalm error. I agree, it would be great if the attribute could also target function parameters as that is what the docs recommend the attribute be used for. 🙏
I really appreciate all of the hard work going into the PHP OTEL libraries!
Hi.
PHPStan will report the error
If used as the examples in the readme. It is working, ignoring the stan error, so I think it just needs to be added to the attribute target? I am however not sure if it will break the anything in the extension code to do so.
This occurs with
open-telemetry/api^1.1.1
, which is as of writing the latest version.