From db60ca12b38dbfd13af6b182d32b49f87bdb5f6c Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 2 Nov 2022 12:03:38 +0100 Subject: [PATCH] move checkout controller trait --- .../Controller/Traits/checkoutGetUserTrait.php} | 10 +++++----- .../Controller/d3_webauthn_OrderController.php | 4 +++- .../Controller/d3_webauthn_PaymentController.php | 4 +++- .../Controller/d3_webauthn_UserController.php | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) rename src/{Modules/Application/Controller/d3_webauthn_getUserTrait.php => Application/Controller/Traits/checkoutGetUserTrait.php} (92%) diff --git a/src/Modules/Application/Controller/d3_webauthn_getUserTrait.php b/src/Application/Controller/Traits/checkoutGetUserTrait.php similarity index 92% rename from src/Modules/Application/Controller/d3_webauthn_getUserTrait.php rename to src/Application/Controller/Traits/checkoutGetUserTrait.php index 4d2bb85..f75507b 100755 --- a/src/Modules/Application/Controller/d3_webauthn_getUserTrait.php +++ b/src/Application/Controller/Traits/checkoutGetUserTrait.php @@ -13,7 +13,7 @@ * @link http://www.oxidmodule.com */ -namespace D3\Webauthn\Modules\Application\Controller; +namespace D3\Webauthn\Application\Controller\Traits; use D3\Webauthn\Application\Model\Webauthn; use D3\Webauthn\Application\Model\WebauthnConf; @@ -25,13 +25,13 @@ use OxidEsales\Eshop\Core\Session; use Psr\Container\ContainerExceptionInterface; use Psr\Container\NotFoundExceptionInterface; -trait d3_webauthn_getUserTrait +trait checkoutGetUserTrait { /** * @return bool|object|User - * @throws Exception - * @throws DoctrineException * @throws ContainerExceptionInterface + * @throws DoctrineException + * @throws Exception * @throws NotFoundExceptionInterface */ public function getUser() @@ -39,7 +39,7 @@ trait d3_webauthn_getUserTrait $user = parent::getUser(); if ($user && $user->getId()) { - $webauthn = $this->d3GetWebauthnpObject(); + $webauthn = $this->d3GetWebauthnObject(); if ($webauthn->isActive($user->getId()) && !$this->d3GetSessionObject()->getVariable(WebauthnConf::WEBAUTHN_SESSION_AUTH) diff --git a/src/Modules/Application/Controller/d3_webauthn_OrderController.php b/src/Modules/Application/Controller/d3_webauthn_OrderController.php index 850bc23..9e3522c 100755 --- a/src/Modules/Application/Controller/d3_webauthn_OrderController.php +++ b/src/Modules/Application/Controller/d3_webauthn_OrderController.php @@ -15,7 +15,9 @@ namespace D3\Webauthn\Modules\Application\Controller; +use D3\Webauthn\Application\Controller\Traits\checkoutGetUserTrait; + class d3_webauthn_OrderController extends d3_webauthn_OrderController_parent { - use d3_webauthn_getUserTrait; + use checkoutGetUserTrait; } \ No newline at end of file diff --git a/src/Modules/Application/Controller/d3_webauthn_PaymentController.php b/src/Modules/Application/Controller/d3_webauthn_PaymentController.php index 45df21e..778ff94 100755 --- a/src/Modules/Application/Controller/d3_webauthn_PaymentController.php +++ b/src/Modules/Application/Controller/d3_webauthn_PaymentController.php @@ -15,7 +15,9 @@ namespace D3\Webauthn\Modules\Application\Controller; +use D3\Webauthn\Application\Controller\Traits\checkoutGetUserTrait; + class d3_webauthn_PaymentController extends d3_webauthn_PaymentController_parent { - use d3_webauthn_getUserTrait; + use checkoutGetUserTrait; } \ No newline at end of file diff --git a/src/Modules/Application/Controller/d3_webauthn_UserController.php b/src/Modules/Application/Controller/d3_webauthn_UserController.php index b304bd3..807b687 100755 --- a/src/Modules/Application/Controller/d3_webauthn_UserController.php +++ b/src/Modules/Application/Controller/d3_webauthn_UserController.php @@ -15,7 +15,9 @@ namespace D3\Webauthn\Modules\Application\Controller; +use D3\Webauthn\Application\Controller\Traits\checkoutGetUserTrait; + class d3_webauthn_UserController extends d3_webauthn_UserController_parent { - use d3_webauthn_getUserTrait; + use checkoutGetUserTrait; } \ No newline at end of file