Psalm: stubs / file_name in config under Windows

Created on 14 Feb 2019  路  6Comments  路  Source: vimeo/psalm

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!

bug

All 6 comments

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

Was this page helpful?
0 / 5 - 0 ratings