Hi,
Just experienced the following issue under Windows:
Cannot resolve stubfile path C:\<path-where-psalm-config-is>\\file://C:\wp\wp-includes\link-template.php
No matter if I'll include file:// or not, the issue is the same, Psalm looks for a directory relative to config path and ignores the full path provided in the config. Is this expected?
Thanks in advance!
It's not Windows-specific, Psalm always treats the stub path as relative: https://github.com/vimeo/psalm/blob/9f1dc425d03c310dfa5766ec3fcea999d1e67a99/src/Psalm/Config.php#L676-L678
Thanks, @weirdan should've looked the source first.
I wouldn't say this is a game breaker but leaves no space for flexibility.
On the other hand, --report argument accepts absolute path.
@weirdan if ($stub_file === realpath($stub_file)) { // is absolute } else { // is relative } ?
@SignpostMarv
use Webmozart\PathUtil\Path;
if (Path::isAbsolute($stub_file)) { /* ... */ }
Still fails on windows - which was the original bug report here, see #2883