Comments (6)
Hello @lasselehtinen,
There is a possible fix that isn't released yet.
Can you try installing the master branch?
composer global require phpro/grumphp:dev-master
from grumphp.
Now I get the following error if I run grumphp on a project where guzzle is already required in composer.json. Works fine on those without though.
grumphp
PHP Fatal error: Cannot redeclare GuzzleHttp\uri_template() (previously declared in C:\path\to\folder\vendor\guzzlehttp\guzzle\src\functions.php:18) in C:\Users\lasleh\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\functions.php on line 265
Fatal error: Cannot redeclare GuzzleHttp\uri_template() (previously declared in C:\path\to\folder\vendor\guzzlehttp\guzzle\src\functions.php:18) in C:\Users\lasleh\AppData\Roaming\Composer\vendor\guzzlehttp\guzzle\src\functions.php on line 265
from grumphp.
Do you have guzzle installed globally as well?
GrumPHP will try to load both the project autoloading as the system autoloading file.
Guzzle added this to the autoloader: "files": ["src/functions_include.php"]
This means that the functions are loaded twice and this triggers the fatal exception.
I don't think this is something we can do something about. If it's possible you can remove the globally installed guzzle?
from grumphp.
I had couple global packages that had guzzle as required. Namely:
https://github.com/laravel/installer
https://github.com/laravel/lumen-installer
https://github.com/vinkla/climb (require knplabs/packagist-api which in turn requires guzzle)
I removed those and now it seems to work. Downside is of course that I cannot have these packages installed at the same time. So is this more of a bug in Guzzle / Composer? I found this but I am not smart enough to figure it out.
from grumphp.
Yes, that seems to be the problem.
As Seldeak mentioned: The functions could be wrapped with function_exists()
in guzzle. But this will require a change in guzzle. At the moment composer can't handle this.
from grumphp.
This fix is tagged ad 0.5.2: https://github.com/phpro/grumphp/releases/tag/v0.5.2
from grumphp.
Related Issues (20)
- PHPMD task does not check all file extensions HOT 5
- Don't do commit message checks on merges? HOT 8
- Memory is not being released in parallel execution HOT 8
- Grumphp running without `.git` folder? HOT 4
- Print the commit message when failing on `git_commit_message` HOT 4
- how can I use grum with docker-compose ? HOT 3
- Fails to Recognize PHPStan Baseline During Commit Workflow
- Override open_basedir only for grumphp test HOT 2
- Grumphp config using default PHPCS XML and other standard's sniff HOT 2
- Undefined constant PhpParser\ParserFactory::PREFER_PHP7 when using `nikic/php-parser` version 5. HOT 1
- Support multiple php versions for tasks HOT 2
- [Task] Add bin/console task for Symfony HOT 1
- husky/lint-staged compatibility HOT 5
- The application requires the version "^7.2" or greater. HOT 2
- Support for multiple PHPStan tasks HOT 2
- How do you think about a configuration to opt-in to continue the commit if fixer could fix everything automatically? HOT 2
- DistFileLoader doesn't import another file
- Add support for git_pre_push HOT 1
- git_blacklist never runs? HOT 5
- Composer validate task not running when composer.lock changes
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.