yii2
yii2 copied to clipboard
Adopt Psalm
See #19174
@samdark I have been working on a Yii2 plugin for psalm . It mainly resolves types for getters and setters, but things like database fields can also support in the future.
I don't think there is a need for generating stubs, only updating some doc blocks to support psalm types. We have some examples of supporting one
and all
methods on ActiveQuery
in our stubs I would be nice to get them upstream somehow, then we can remove the stubs.
Feel free to have a poke around, sorry the docs are not there yet if you want any info then let me know, and I will do what I can to help.
would be nice to get them upstream somehow
@AdeAttwood well, a pull request would do.
@AdeAttwood do you see latest manual? Stub files
- stubs using to specify special/custom PHPDoc tags when it's need
- with stubs analyze work faster
-
practically/psalm-plugin-yii2
doesn't cover code well enough(behaviors, application, AR attributes and etc.) + require >=PHP 7.1
@AdeAttwood well, a pull request would do.
Yea, we can do that. There will need to be some discussion on the types. It is quite opinionated about the doc blocks, for example you will get an error about missing template parameters, but this can be discussed more on the upcoming PR :+1:.
@WinterSilence this not the purpose of the stubs. From the psalm docs you linked to.
Stub files provide a way to override third-party type information when you cannot add Psalm's extended docblocks to the upstream source files directly.
For most of it Yii2 type definitions are really good, we have created stubs to override the types defined by Yii2
@AdeAttwood
Stub files provide a way to override third-party type information when you cannot add Psalm's extended docblocks to the upstream source files directly.
is
stubs using to specify special/custom PHPDoc tags when it's need
but this is not only purpose of stubs
For most of it Yii2 type definitions are really good, we have created stubs to override the types defined by Yii2
I'm know how work this plugin - as you remember, I also contribute it. But plugin doesn't cover Yii2 features(behaviors, application/modules, DI, AR attributes) well enough and in some cases it does more harm than useful - we can't easy analyze methods/properties of Yii2 classes extending BaseObject
only by code, but that's plugin trying do it and fail.
@AdeAttwood https://github.com/yiisoft/yii2/pull/19174#issuecomment-1024346343
I do not see this happening, given the conversations. Is there any new information since last time? Is anyone interested in making this happen?
Since Yii2 is in feature freeze mode, I will close this one