Implemented respecting __get
and __set
- this will get pre-released within upcoming days :-)
Support for PHPStan
- Edited
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.
- Edited
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?
TauriT yes, we didn't implement it yet :)
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 we can add a diagnostic for that! :)
- Edited
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)
- Edited
@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
Jean-FrancoisHIVERT Is it something already used somewhere? I'd prefer to use some standard notation.
I believe wildcard does not exist so it is normal do not implement that.
Is it possible to implement something else?
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.