Skip to content

Commit 7da4a4a

Browse files
authored
fix(config-provider): ensure class_exists before instantiation (#105)
preservefix(config-provider): ensure class_exists before instantiation Fixed an issue in ConfigProvider where a class was being instantiated without first checking if it exists. Exists when executing `php bin/hyperf.php server:watch`command
1 parent 3f9e693 commit 7da4a4a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ConfigProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __invoke()
3737
foreach ($mineJsonPaths as $jsonPath) {
3838
if (file_exists($jsonPath->getPath() . '/' . Plugin::INSTALL_LOCK_FILE)) {
3939
$info = json_decode(file_get_contents($jsonPath->getRealPath()), true);
40-
if (! empty($info['composer']['config'])) {
40+
if (! empty($info['composer']['config']) && class_exists($info['composer']['config'])) {
4141
$provider = (new ($info['composer']['config']))();
4242
$initialConfig = array_merge_recursive($provider, $initialConfig);
4343
}

0 commit comments

Comments
 (0)