【发布时间】:2019-10-31 07:44:10
【问题描述】:
我刚刚重新安装了 CakePHP 4.x(确切地说是4.x-dev)并安装了身份验证插件(2.x-dev)。我在这里遵循快速入门指南:https://github.com/cakephp/authentication/blob/2.x-get/docs/Quick-start-and-introduction.md
我添加了必要的使用声明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
【问题讨论】: