New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Fatal error: Cannot redeclare info() #410

Closed
jhhazelaar opened this Issue Sep 27, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@jhhazelaar

jhhazelaar commented Sep 27, 2017

I've want to install your tool for some clean coding. But when I try to run grumphp in my terminal I get the following error:

PHP Fatal error:  Cannot redeclare info() (previously declared in .../vendor/laravel/framework/src/Illuminate/Foundation/helpers.php:498) in .../.composer/vendor/laravel/valet/cli/includes/helpers.php on line 24

I'm using Laravel Framework and Laravel Valet on a mac os computer.

Any ideas? Or am I looking at the wrong packages to find the soluction.

@veewee

This comment has been minimized.

Contributor

veewee commented Sep 28, 2017

Hi @jhhazelaar,

You probably have the package Illuminate/Foundation installed both globally and locally?
Then this is related to #91.

In that case, the problem is that the package does not have proper autoloading for functions. (More specific: a function_exists around the function declaration)

@jhhazelaar

This comment has been minimized.

jhhazelaar commented Sep 28, 2017

Hi @veewee,

Thanks for the quick response. I've looked at the composer global installed packages with composer global show -i the Illuminate/Foundation isn't installed.

Oke, WTF! If was trying somethings and stop valet. Run grumphp -v and it works. Started valet and grumphp still works. No more error!

So you can close the issue :-D

@jhhazelaar jhhazelaar closed this Sep 28, 2017

@jhhazelaar

This comment has been minimized.

jhhazelaar commented Sep 28, 2017

Sorry... still got it. So in a project folder with a repository where Laravel is installed I get the error.

@jhhazelaar jhhazelaar reopened this Sep 28, 2017

@veewee

This comment has been minimized.

Contributor

veewee commented Sep 29, 2017

Hi @jhhazelaar,

I am not using Laravel nor Valet myself so you'll have to dig into this one a bit deeper yourself.
Can you check following paths to find out which and how many composer files are being loaded:
https://github.com/phpro/grumphp/blob/master/bin/grumphp#L6-L11

There probably is a second composer file which is causing this error as mentioned above.
Also note that the package you are using is abandoned so a fix is probably not going to get merged.
https://packagist.org/packages/illuminate/foundation

@veewee

This comment has been minimized.

Contributor

veewee commented Mar 30, 2018

Hi @jhhazelaar, Since this question hasn't had an update for about a half year, I am closing this issue. Feel free to provide any additional feedback!

@veewee veewee closed this Mar 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment