diff --git a/composer.json b/composer.json index b0b52adaf..a6b05a725 100644 --- a/composer.json +++ b/composer.json @@ -83,7 +83,7 @@ "symfony/property-access": "^5.0", "symfony/serializer": "^5.0", "twig/twig": "^2.12", - "vlucas/phpdotenv": "^4.0", + "vlucas/phpdotenv": "^5.0", "xxtime/flysystem-aliyun-oss": "^1.5" }, "replace": { diff --git a/src/config/composer.json b/src/config/composer.json index 1eb2b9087..b407b0f36 100644 --- a/src/config/composer.json +++ b/src/config/composer.json @@ -18,11 +18,10 @@ }, "require": { "php": ">=7.2", - "psr/container": "^1.0", - "vlucas/phpdotenv": "^4.0", - "symfony/finder": "^5.0", "hyperf/contract": "~2.1.0", - "hyperf/utils": "~2.1.0" + "hyperf/utils": "~2.1.0", + "psr/container": "^1.0", + "symfony/finder": "^5.0" }, "require-dev": { "hyperf/di": "~2.1.0", diff --git a/src/di/composer.json b/src/di/composer.json index b0a1668b8..d86f9415e 100644 --- a/src/di/composer.json +++ b/src/di/composer.json @@ -23,7 +23,8 @@ "nikic/php-parser": "^4.1", "psr/container": "^1.0", "roave/better-reflection": "^4.0", - "symfony/finder": "^5.0" + "symfony/finder": "^5.0", + "vlucas/phpdotenv": "^5.0" }, "require-dev": { "malukenho/docheader": "^0.1.6", diff --git a/src/di/src/ClassLoader.php b/src/di/src/ClassLoader.php index 8977a4f18..78988b7e7 100644 --- a/src/di/src/ClassLoader.php +++ b/src/di/src/ClassLoader.php @@ -128,13 +128,8 @@ class ClassLoader protected function loadDotenv(): void { - $repository = RepositoryBuilder::create() - ->withReaders([ - new Adapter\PutenvAdapter(), - ]) - ->withWriters([ - new Adapter\PutenvAdapter(), - ]) + $repository = RepositoryBuilder::createWithNoAdapters() + ->addAdapter(Adapter\PutenvAdapter::class) ->immutable() ->make();