Implemented respecting __get and __set - this will get pre-released within upcoming days :-)

5 months later

JakubMisek Is it possible to get missing property warning even if the __get magic method exists? I would like to define all existing properties via @property [type] [name] even if the __get method exists and suppress the warning for the classes that I choose.

    TauriT maybe .. if there is some @property tag, then missing properties should be checked even if there is the __get magic method.

    We'd like to avoid falsy warnings for the other users and common composer packages.

      JakubMisek Does not seem to work correctly or am I missing something?

        JakubMisek There seem to be even bigger issues regarding @property annotations. It is not recognising basic properties in some cases but I have not managed to pull simplified example out of my main project.

          TauriT Okay looks like i was missing $ from the property name in annotation.

            5 days later

            implemented - undefined property will be reported even there is __get/__set if there are already some @property in doc blocks defined.

            we have also added diagnostic for incorrectly defined @property (with missing property $name)

              22 days later

              @JakubMisek Hi, about this feature:

              implemented - undefined property will be reported even there is __get/__set if there are already some @property in doc blocks defined.

              I think you need to implement a workaround when we have a class with __get/__set and some static properties like for a timer class start and stop but also with dynamic properties like checkpoints.

              Is it possible to have a wildcard property for example?

              /**
               * @property int $start
               * @property int $stop
               * @property int $*
               */

              Thank you

                I believe wildcard does not exist so it is normal do not implement that.
                Is it possible to implement something else?

                  3 months later

                  Hi all,

                  Native support for things like @phpstan-type and global types in phpstan.neon files would be very beneficial to us!

                  For context: we work with WordPress and frequently create global array shapes in our phpstan.neon file for upstream dependencies that we don't have control over.

                  Write a Reply...