我刚刚重新安装了 CakePHP 4.x(4.x-dev
准确地说)并安装了身份验证插件 ( 2.x-dev
)。我遵循这里的快速入门指南:https : //github.com/cakephp/authentication/blob/2.x-get/docs/Quick-start-and-introduction.md
我添加了必要的 use 声明,implements AuthenticationServiceProviderInterface
并添加了getAuthenticationService(ServerRequestInterface $request)
函数和必要的中间件添加项,但出现致命错误:
致命错误:App\Application::getAuthenticationService(Psr\Http\Message\ServerRequestInterface $request) 的声明必须与 Authentication\AuthenticationServiceProviderInterface::getAuthenticationService(Psr\Http\Message\ServerRequestInterface $request) 兼容:Authentication\AuthenticationServiceInterface in /src /Application.php 第 40 行。
第 40 行是:
class Application extends BaseApplication implements AuthenticationServiceProviderInterface