Psalm: Add `<psalm phpVersion="7.2"` support to psalm.xml

Created on 15 Jan 2020  路  7Comments  路  Source: vimeo/psalm

(the syntax isn't important)

Related to #1191

Some applications will only be deployed on one version of php most of the time.
It's inconvenient to add --php-version 7.2 to all invocations (language server, manual runs, etc).

--php-version should override the psalm.xml setting.

enhancement

Most helpful comment

--php-version 7.2

I get this error:

Cannot local 7.2

馃

--php-version=7.2

All 7 comments

Hey @TysonAndre, can you reproduce the issue on https://psalm.dev ?

Just looking for a way to specify the PHP version supported: so, currently there is no way to specifcy which version to check against? Because Psalm warns that I can add a type hint to method param, but I cannot as the interface doesn't have one and the concrete method cannot add it without breaking the code on PHP 7.2.

@Aerendir it's not possible to specify in the config currently, but you can pass --php-version 7.2 in cli arguments.

--php-version 7.2

I get this error:

Cannot local 7.2

馃

--php-version 7.2

I get this error:

Cannot local 7.2

馃

--php-version=7.2

It works with the = sign, but it should be able to read it also without it 馃Anyway, it works...

Another idea would be to get the version from the minimum specified in composer.json if one is present.

I'll try my hands on a PR

Was this page helpful?
0 / 5 - 0 ratings