2
嗨我正在使用slim和cartalyst \ sentinel登录应用程序。当我创建哨兵提醒$reminder = new Cartalyst\Sentinel\Reminders\IlluminateReminderRepository;
的新实例时,它会给UserRepositoryInterface error __construct() must implement interface Cartalyst\Sentinel\Users\UserRepositoryInterface
实施一个错误。在运行时实现接口PHP
我的问题是我如何在运行时在php中实现一个接口。
虽然在上面我使用了激活类,它也实现了src代码中的接口,如class IlluminateActivationRepository implements ActivationRepositoryInterface
但它不会给出错误。
这下面的激活类工作正常。
$activation = (new Cartalyst\Sentinel\Activations\IlluminateActivationRepository)->create($user);