Skip to content
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

Plugin incompatibility with vlucas/phpdotenv v3.3.3 #26

Closed
Slayvin opened this issue Apr 10, 2019 · 3 comments
Closed

Plugin incompatibility with vlucas/phpdotenv v3.3.3 #26

Slayvin opened this issue Apr 10, 2019 · 3 comments

Comments

@Slayvin
Copy link

Slayvin commented Apr 10, 2019

I've added vlucas/phpdotenv v3.3.3 to my composer.json, but then it shows a fatal error:

Uncaught TypeError: Argument 1 passed to Dotenv\Dotenv::__construct() must be an instance of Dotenv\Loader, string given, called in ...\site\vendor\hiqdev\composer-config-plugin\src\readers\EnvReader.php on line 28 and defined in ...\site\vendor\vlucas\phpdotenv\src\Dotenv.php:31

In their README, they have a section called Upgrading from v2 that says :

Consequently, you will need to replace any occurrences of new Dotenv(...) with Dotenv::create(...), since our new native constructor takes a Loader instance now, so that it can be truly customized if required.

I downgraded to v2.6.1 by adding this: composer require vlucas/phpdotenv:^2.0 and now it's working.

This should be specified in the docs maybe?

@hiqsol
Copy link
Member

hiqsol commented Apr 11, 2019

Strange, I did fixed the plugin for phpdotenv 3+.
I'll check it once more.
Which version exactly is installed in your case?

@hiqsol
Copy link
Member

hiqsol commented Apr 11, 2019

I've released the latest changes.
Should be ok now.

@hiqsol hiqsol closed this as completed Apr 11, 2019
@Slayvin
Copy link
Author

Slayvin commented Apr 11, 2019

Thanks!
Related to #22

xepozz added a commit to xepozz/hiqdev-fork-composer-config-plugin that referenced this issue Apr 22, 2020
* Some fixes

* Remove redundant variable

* Replace superclass name to self

* Rename method + add type hints

* Cleanup & optimize code

* Fix conflict merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants