Comments (6)
Can you paste your composer file and steps to reproduce the error?
from grumphp-shim.
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.
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.
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.
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.
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)
- git_hook_variables not used in phar HOT 8
- Task implementing AbstractExternalTask is not working HOT 8
- TwigCS default ruleset gets prefixed HOT 1
- Intl polyfill not installed
- Minimum PHP version difference from phpro/grumphp HOT 2
- Support PHP 8.1 in Gitonomy HOT 7
- Problem with GrumPHP shim and _HumbugBox ContainerBuilder HOT 4
- `composer.lock` validation failing HOT 12
- "grumphp" shell-script broken HOT 1
- GrumShim dependency KO HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grumphp-shim.