Skip to content

False positive property.onlyWritten #14703

@Slamdunk

Description

@Slamdunk

Bug report

Source: https://github.com/lcobucci/jwt/actions/runs/26173872082/job/76998706779

The issues to focus on from the playground are:

  • 35: Property Lcobucci\JWT\Configuration::$encoder is never read, only written.
  • 36: Property Lcobucci\JWT\Configuration::$decoder is never read, only written.

But both are instead read many times in the class.

Code snippet that reproduces the problem

https://phpstan.org/r/9cb3f134-f0aa-4efb-befc-d417dfb9ffde

Expected output

No property.onlyWritten error

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions