psalm / phar Goto Github PK
View Code? Open in Web Editor NEWA place for Psalm's Phar to live in a composer-versioned setting
Home Page: https://psalm.dev
A place for Psalm's Phar to live in a composer-versioned setting
Home Page: https://psalm.dev
Hello, I'm getting the following error on psalm/phar installations from v4.17.0 to the latest version.
Running the command ./bin/psalm.phar --update-baseline
:
Uncaught RuntimeException: PHP Error: Declaration of Psalm\Internal\Fork\PsalmRestarter::requiresRestart($default): bool should be compatible with _HumbugBox313437bf04ad\Composer\XdebugHandler\XdebugHandler::requiresRestart(bool $default): bool in phar:///var/www/app/vendor/psalm/phar/psalm.phar/src/Psalm/Internal/Fork/PsalmRestarter.php:15 in phar:///var/www/app/vendor/psalm/phar/psalm.phar/src/Psalm/Internal/ErrorHandler.php:53
Stack trace:
#0 phar:///var/www/app/vendor/psalm/phar/psalm.phar/src/Psalm/Internal/Fork/PsalmRestarter.php(15): Psalm\Internal\ErrorHandler::Psalm\Internal\{closure}(2, 'Declaration of ...', 'phar:///var/www...', 15, Array)
#1 phar:///var/www/app/vendor/psalm/phar/psalm.phar/.box/vendor/composer/ClassLoader.php(444): include('phar:///var/www...')
#2 phar:///var/www/app/vendor/psalm/phar/psalm.phar/.box/vendor/composer/ClassLoader.php(322): Composer\Autoload\includeFile('phar:///var/www...')
#3 [internal function]: Composer\Autoload\ClassLoader->loadClass('Psalm\\Internal\\...')
#4 phar:///var/www/app/vendor/psalm/phar/psalm.phar/src/Psalm/Internal/Cli/Psalm.php(569): spl_autoload_call('Psalm\\Internal\\...')
#5 phar:///var/www/app/vendor/psalm/phar/psalm.phar/src/Psalm/Internal/Cli/Psalm.php(206): Psalm\Internal\Cli\Psalm::restart(Array, Object(Psalm\Config), 1)
#6 phar:///var/www/app/vendor/psalm/phar/psalm.phar/psalm(7): Psalm\Internal\Cli\Psalm::run(Array)
#7 /var/www/app/vendor/psalm/phar/psalm.phar(14): require('phar:///var/www...')
#8 {main}
(Psalm 4.x-dev@ crashed due to an uncaught Throwable)
A tag refs/tags/4.6.2
seems to have been created but since there's no tag 4.6.2
composer can't find it.
vimeo/psalm
5.0.0-alpha1 and 5.0.0-beta1 requires PHP ^7.4 || ~8.0.0 || ~8.1.0
while psalm/phar
of these versions requires ^7.1 || ^8.0
additionally, psalm/phar
does not require any extensions, which vimeo/psalm
requires.
I use psalm/phar
4.23.0
When running on PHP 8.1 I get the following output:
PHP Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 15
Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 15
PHP Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 19
Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 19
PHP Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 15
Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 15
PHP Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 19
Deprecated: Return type of HumbugBox383\KevinGH\RequirementChecker\RequirementCollection::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in phar:///var/app/vendor/psalm/phar/psalm.phar/.box/src/RequirementCollection.php on line 19
Target PHP version: 7.4 (inferred from composer.json)
Scanning files...
Analyzing files...
Probably it has something to do with the used Box project version?
Using psalm.phar --report-show-info=false --report=checkstyle.xml
it still outputs to STDOUT in default format with INFO messages. Essentially the same output that I would get when running just psalm.phar
.
The problem doesn't occur when using the psalm.phar
from the releases page of vimeo/psalm
repo.
Hey there,
most plugins usually require vimeo/psalm
in a specific version.
I wonder if it is possible to actually change conflict
to replace
while using self.version
.
For every psalm release, there is also a version in here.
This way, this component can actually provide vimeo/psalm
in a specific version and also allows plugins to be installed while keeping composer dependency tree up and running.
Thoughts?
Or do you have reasons for explicitly conflicting with vimeo/psalm
?
At the moment it's impossible to install a psalm plugin because phar/psalm
has a conflict with vimeo/psalm
which plugins depend on (for instance https://github.com/psalm/psalm-plugin-phpunit/blob/138998ffd32b76a2e69eb1ff94ef2bf110967273/composer.json#L22). A possible solution might be composer's replace feature.
Using psalm.phar --version
for the latest 4.5.1 release shows Psalm 4.x-dev@
. Expected to see version number 4.5.1
.
P.S. I used phive
to update psalm which got the file https://github.com/vimeo/psalm/releases/download/4.5.1/psalm.phar
.
When using this package the executable phar is called vendor/bin/psalm.phar
This could lead to some confusion when the official guide is used, as it refers to vendor/bin/psalm
as the command to run.
Could you please add the missing releases?
Last release here is 4.3.1, but on vimeo/psalm it is 4.4.1 (see https://github.com/vimeo/psalm/releases).
Consider the following code:
<?php
function check(string $filename): bool
{
if (strpos($filename, ".suback.php") !== false || strpos($filename, "_backup") !== false) {
// we'll ignore .suback files, they are old upgrade backups
return false;
}
return true;
}
The latest psalm/phar 4.12.0
returns:
ERROR: RedundantCondition - t.php:4:9 - int can never contain false (see https://psalm.dev/122)
if (strpos($filename, ".suback.php") !== false || strpos($filename, "_backup") !== false) {
ERROR: RedundantCondition - t.php:4:55 - int can never contain false (see https://psalm.dev/122)
if (strpos($filename, ".suback.php") !== false || strpos($filename, "_backup") !== false) {
While psalm.dev returns expected result
It'd be useful to still be able to use the correct version of the config.xsd
when using the phar.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.