Skip to content

Commit d592c3d

Browse files
committed
CABPI-479: Minor code corrections for Service class
1 parent 32724c3 commit d592c3d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

app/code/Magento/AdminAdobeIms/Model/Authorization/AdobeImsAdminTokenUserService.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
use Magento\AdobeImsApi\Api\OrganizationMembershipInterface;
2020
use Magento\Framework\App\RequestInterface;
2121
use Magento\Framework\Exception\AuthenticationException;
22+
use Magento\Framework\Exception\AuthorizationException;
2223

2324
/**
2425
* Adobe IMS Auth Model for getting Admin Token
@@ -68,7 +69,7 @@ class AdobeImsAdminTokenUserService
6869
/**
6970
* @var TokenResponseInterfaceFactory
7071
*/
71-
private $tokenResponseFactory;
72+
private TokenResponseInterfaceFactory $tokenResponseFactory;
7273

7374
/**
7475
* @param ImsConfig $adminImsConfig
@@ -107,7 +108,7 @@ public function __construct(
107108
* @return void
108109
* @throws AdobeImsAuthorizationException
109110
* @throws AdobeImsOrganizationAuthorizationException
110-
* @throws AuthenticationException
111+
* @throws AuthenticationException|AuthorizationException
111112
*/
112113
public function processLoginRequest(bool $isReauthorize = false): void
113114
{
@@ -141,10 +142,10 @@ public function processLoginRequest(bool $isReauthorize = false): void
141142
/**
142143
* Get requested token using Authorization header
143144
*
144-
* @return \Magento\AdobeImsApi\Api\Data\TokenResponseInterface
145+
* @return TokenResponseInterface
145146
* @throws AuthenticationException
146147
*/
147-
private function getRequestedToken()
148+
private function getRequestedToken(): TokenResponseInterface
148149
{
149150
$authorizationHeaderValue = $this->request->getHeader('Authorization');
150151
if (!$authorizationHeaderValue) {
@@ -171,9 +172,11 @@ private function getRequestedToken()
171172
* @param bool $isReauthorize
172173
* @param TokenResponseInterface $tokenResponse
173174
* @return void
175+
* @throws AdobeImsAuthorizationException
174176
* @throws AuthenticationException
177+
* @throws AuthorizationException
175178
*/
176-
private function getLoggedIn(bool $isReauthorize, TokenResponseInterface $tokenResponse)
179+
private function getLoggedIn(bool $isReauthorize, TokenResponseInterface $tokenResponse): void
177180
{
178181
$profile = $this->profile->getProfile($tokenResponse->getAccessToken());
179182
if (empty($profile['email'])) {

0 commit comments

Comments
 (0)