Giter Club home page Giter Club logo

phar's People

Contributors

muglug avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

phar's Issues

PHP Error: Declaration of X should be compatible with Y

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)

PHP 8.1 deprecations

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?

Config options ignored

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.

Conflict with `vimeo/psalm` prohibits the installation of plugins

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?

Proper version not displayed

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.

Rename psalm.phar to psalm

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.

Unexpected RedundantCondition

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

https://psalm.dev/r/0cc1635fe5

Add config.xsd

It'd be useful to still be able to use the correct version of the config.xsd when using the phar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.