Closed caugner closed 3 years ago
This causes PhpStorm inspection errors ("General" > "Class hierarchy checks") on classes extending Model
How come phpstorm is interpreting these classes? They intentionally don't end in .php
to prevent this!
https://psalm.dev/docs/running_psalm/plugins/authoring_plugins/#stub-files
By convention, stub files have .phpstub extension to avoid IDEs treating them as actual php code
I must have configured *.stubphp
to be recognised as PHP when I was working on the PRs, and wasn't aware that this affects all projects. š¤¦
Closing this, as removing that file name pattern again resolved the issue for me.
Describe the bug The abstract
Model
class implements several interfaces, and so does theModel.stubphp
:https://github.com/psalm/psalm-plugin-laravel/blob/28b697a39aa96986733aae79415bfd776306436f/stubs/Model.stubphp#L17
However,
Model.stubphp
doesn't implement them. This causes PhpStorm inspection errors ("General" > "Class hierarchy checks") on classes extendingModel
:Impacted Versions
Additional context A workaround might be for users of this plugin to move psalm (and all psalm plugins, including this one) to
vendor-bin
using composer-bin-plugin, because stubs in thevendor-bin/*/vendor
folders are (probably?) ignored by PhpStorm.