Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix not finding vendor paths, closes psalm#9
Previously paths to dependencies were resolved against the current working directory and the plugin crashed early if the current working directory is different with a RuntimeException making Psalm failing to load the PsalmWordPress\Plugin. This has been tested against a scenario where psalm is available as tools/psalm in the project and the composer.json lies within the tools/ folder. This would also be the case if the vendor directory is not named "vendor" or when installing psalm with the composer-bin plugin (which is sometimes suggested in the psalm project [1]). Fix here is to check for the other packages folders relative to its own package folder in case the original path relative to the current working directory is not a directory. It is done in a way that effectively prevents checking for the name "vendor" for the [vendor-dir] in case it is installed as a package. [1]: vimeo/psalm#2905 (comment) [vendor-dir]: https://getcomposer.org/doc/06-config.md#vendor-dir
- Loading branch information