Giter Site home page Giter Site logo

Comments (6)

veewee avatar veewee commented on August 26, 2024

Can you paste your composer file and steps to reproduce the error?

from grumphp-shim.

nicrodgers avatar nicrodgers commented on August 26, 2024

It's on a project with a pretty huge composer file. I'll see if I can create an example with a minimal amount of projects required.

from grumphp-shim.

nicrodgers avatar nicrodgers commented on August 26, 2024

Here we go - was easier than I thought :)

composer.json:

{
    "require": {
        "mglaman/drupal-check": "^1.1",
        "phpro/grumphp-shim": "^0.19.0"
    }
}

steps to reproduce:

  • composer install

result:
PHP warning is displayed
Warning: Cannot declare interface Stringable, because the name is already in use in phar:///Volumes/www/sandbox/grumphp/vendor/phpstan/phpstan/phpstan.phar/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php on line 12

Maybe I need to a file a bug on the PHPStan project instead? Let me know what you think. Thanks.

from grumphp-shim.

veewee avatar veewee commented on August 26, 2024

It looks more like a PHPStan issue:

First it makes sure composer always loads the phpstan bootstrap file:
https://github.com/phpstan/phpstan/blob/master/composer.json#L21

Next, it registers an autoloader that only works inside phars (which grumphp-shim is)
https://github.com/phpstan/phpstan/blob/master/bootstrap.php
This is most likely under the assumption that it only runs for phpstan?

The phpstan package also contain the php-80 stubs, so that is why you are seeing the Warning. It is indeed not blocking, but still a bit strange.

GrumPHP will always try to load the project specific autoloader to make sure local classes can be loaded as well.

from grumphp-shim.

nicrodgers avatar nicrodgers commented on August 26, 2024

Thanks for looking in to this and providing such comprehensive feedback so quickly! I'll raise an issue with the phpstan team.

from grumphp-shim.

nicrodgers avatar nicrodgers commented on August 26, 2024

Just posting the link to the phpstan issue for anyone who might land on this in the future: phpstan/phpstan#3457

from grumphp-shim.

Related Issues (11)

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.