我正在使用 TYPO3 10.2 并尝试将我创建的一些服务类注入到我的身份验证服务中。
class AuthService extends \TYPO3\CMS\Core\Authentication\AuthenticationService
AuthService 中的构造函数:
/**
* Contains the configuration of the current extension
* @var ConfigurationService
*/
protected $configurationService;
/**
* @var RestClientService
*/
protected $restClientService;
/**
* @var ConnectionPool
*/
protected $connectionPool;
/**
*
* @param ConfigurationService $configurationService
* @param RestClientService $restClientService
* @param ConnectionPool $connectionPool
*/
public function __construct(ConfigurationService $configurationService, RestClientService $restClientService, ConnectionPool $connectionPool)
{
$this->configurationService = $configurationService;
$this->restClientService = $restClientService;
$this->connectionPool = $connectionPool;
}
我收到以下错误:
函数 Vendor\MyExt\Service\AuthService::__construct() 的参数太少,第 3461 行的 C:\xampp\htdocs\myproject\typo3\sysext\core\Classes\Utility\GeneralUtility.php 中传递了 0,而预期为 3
有什么建议吗?
我在 ControllerClass 中使用了相同的构造函数,并且在那里一切正常。
到目前为止感谢!
波斯汪