OpenAPICommand 未定义

问题描述 投票:0回答:1

我是 Symfony 的新手,当我尝试以下命令时,我只是在遵循 api 设置教程:

php bin/console make:factory
,并收到以下错误:

 In DebugClassLoader.php line 350:
The autoloader expected class "ApiPlatform\Symfony\Bundle\Command\OpenApiCommand" to be defined in file "/Users/myUsername/Sites/localhost/myProject/vendor/composer/../api-platform/core/src/Symfony/Bundle/Command/OpenApiCommand.php". The file was found but the class was not in it, the class name or namespace probably has a typo. 

我看了下课,里面有以下内容;考虑到代码,我不明白如何定义它:

declare(strict_types=1);

namespace ApiPlatform\Symfony\Bundle\Command;

class_exists(\ApiPlatform\OpenApi\Command\OpenApiCommand::class);

if (false) {
    final class OpenApiCommand extends \ApiPlatform\OpenApi\Command\OpenApiCommand
    {
    }
}

类定义在静态错误的子句中。 到目前为止,项目中的所有代码都已生成;我没有更改任何文件。有谁知道这是怎么发生的或为什么会发生?

symfony api-platform.com
1个回答
0
投票

我应该在执行命令之前安装 foundry。现在一切都按预期进行。我认为获取缺少的依赖项是一个奇怪的错误。如果有人愿意为我解释这一点以便更好地理解,我将不胜感激。谢谢。

© www.soinside.com 2019 - 2024. All rights reserved.