2022-11-22 00:26:04 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace D3\Webauthn\Application\Controller\Traits;
|
|
|
|
|
|
|
|
use D3\Webauthn\Application\Model\Credential\PublicKeyCredential;
|
|
|
|
use D3\Webauthn\Application\Model\Credential\PublicKeyCredentialList;
|
|
|
|
use D3\Webauthn\Application\Model\Webauthn;
|
|
|
|
use OxidEsales\Eshop\Application\Model\User;
|
|
|
|
use OxidEsales\Eshop\Core\Registry;
|
2022-11-23 00:18:09 +01:00
|
|
|
use OxidEsales\Eshop\Core\Routing\ControllerClassNameResolver;
|
|
|
|
use OxidEsales\Eshop\Core\Session;
|
2022-11-22 00:26:04 +01:00
|
|
|
use OxidEsales\Eshop\Core\Utils;
|
|
|
|
use OxidEsales\Eshop\Core\UtilsView;
|
|
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
|
|
|
|
trait helpersTrait
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @return User
|
|
|
|
*/
|
2022-11-23 00:18:09 +01:00
|
|
|
public function d3GetUserObject(): User
|
2022-11-22 00:26:04 +01:00
|
|
|
{
|
|
|
|
return oxNew(User::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Webauthn
|
|
|
|
*/
|
2022-11-23 00:18:09 +01:00
|
|
|
public function d3GetWebauthnObject(): Webauthn
|
2022-11-22 00:26:04 +01:00
|
|
|
{
|
|
|
|
return oxNew(Webauthn::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return LoggerInterface
|
|
|
|
*/
|
2022-11-23 00:18:09 +01:00
|
|
|
public function d3GetLoggerObject(): LoggerInterface
|
2022-11-22 00:26:04 +01:00
|
|
|
{
|
|
|
|
return Registry::getLogger();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Utils
|
|
|
|
*/
|
2022-11-23 00:18:09 +01:00
|
|
|
public function d3GetUtilsObject(): Utils
|
2022-11-22 00:26:04 +01:00
|
|
|
{
|
|
|
|
return Registry::getUtils();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return UtilsView
|
|
|
|
*/
|
2022-11-23 00:18:09 +01:00
|
|
|
public function d3GetUtilsViewObject(): UtilsView
|
2022-11-22 00:26:04 +01:00
|
|
|
{
|
|
|
|
return Registry::getUtilsView();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return PublicKeyCredentialList
|
|
|
|
*/
|
2022-11-23 00:18:09 +01:00
|
|
|
public function d3GetPublicKeyCredentialListObject(): PublicKeyCredentialList
|
2022-11-22 00:26:04 +01:00
|
|
|
{
|
|
|
|
return oxNew(PublicKeyCredentialList::class);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return PublicKeyCredential
|
|
|
|
*/
|
2022-11-23 00:18:09 +01:00
|
|
|
public function d3GetPublicKeyCredentialObject(): PublicKeyCredential
|
2022-11-22 00:26:04 +01:00
|
|
|
{
|
|
|
|
return oxNew(PublicKeyCredential::class);
|
|
|
|
}
|
2022-11-23 00:18:09 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return Session
|
|
|
|
*/
|
|
|
|
public function d3GetSession(): Session
|
|
|
|
{
|
|
|
|
return Registry::getSession();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return ControllerClassNameResolver
|
|
|
|
*/
|
|
|
|
public function d3GetControllerClassNameResolver(): ControllerClassNameResolver
|
|
|
|
{
|
|
|
|
return Registry::getControllerClassNameResolver();
|
|
|
|
}
|
2022-11-22 00:26:04 +01:00
|
|
|
}
|