@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | /** |
| 300 | 300 | * Fetch a protected ressource |
| 301 | 301 | * |
| 302 | - * @param string $protected_ressource_url Protected resource URL |
|
| 302 | + * @param string $protected_resource_url Protected resource URL |
|
| 303 | 303 | * @param array $parameters Array of parameters |
| 304 | 304 | * @param string $http_method HTTP Method to use (POST, PUT, GET, HEAD, DELETE) |
| 305 | 305 | * @param array $http_headers HTTP headers |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | /** |
| 481 | 481 | * Converts the class name to camel case |
| 482 | 482 | * |
| 483 | - * @param mixed $grant_type the grant type |
|
| 483 | + * @param integer $grant_type the grant type |
|
| 484 | 484 | * @return string |
| 485 | 485 | */ |
| 486 | 486 | private function convertToCamelCase($grant_type) |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | const ACCESS_TOKEN_MAC = 3; |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | - * Different Grant types |
|
| 23 | - */ |
|
| 22 | + * Different Grant types |
|
| 23 | + */ |
|
| 24 | 24 | const GRANT_TYPE_AUTH_CODE = 'authorization_code'; |
| 25 | 25 | const GRANT_TYPE_PASSWORD = 'password'; |
| 26 | 26 | const GRANT_TYPE_CLIENT_CREDENTIALS = 'client_credentials'; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | $curl_options[CURLOPT_POST] = true; |
| 398 | 398 | /* No break */ |
| 399 | 399 | case self::HTTP_METHOD_PUT: |
| 400 | - case self::HTTP_METHOD_PATCH: |
|
| 400 | + case self::HTTP_METHOD_PATCH: |
|
| 401 | 401 | |
| 402 | 402 | /** |
| 403 | 403 | * Passing an array to CURLOPT_POSTFIELDS will encode the data as multipart/form-data, |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | 'The \'username\' parameter must be defined for the Password grant type', |
| 30 | 30 | InvalidArgumentException::MISSING_PARAMETER |
| 31 | 31 | ); |
| 32 | - } |
|
| 33 | - elseif (!isset($parameters['password'])) |
|
| 32 | + } elseif (!isset($parameters['password'])) |
|
| 34 | 33 | { |
| 35 | 34 | throw new InvalidArgumentException( |
| 36 | 35 | 'The \'password\' parameter must be defined for the Password grant type', |
@@ -29,8 +29,7 @@ |
||
| 29 | 29 | 'The \'code\' parameter must be defined for the Authorization Code grant type', |
| 30 | 30 | InvalidArgumentException::MISSING_PARAMETER |
| 31 | 31 | ); |
| 32 | - } |
|
| 33 | - elseif (!isset($parameters['redirect_uri'])) |
|
| 32 | + } elseif (!isset($parameters['redirect_uri'])) |
|
| 34 | 33 | { |
| 35 | 34 | throw new InvalidArgumentException( |
| 36 | 35 | 'The \'redirect_uri\' parameter must be defined for the Authorization Code grant type', |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | use TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject; |
| 19 | 19 | |
| 20 | -class Account extends AbstractDomainObject { |
|
| 20 | +class Account extends AbstractDomainObject { |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * @var string |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | - * @param ObjectManager $objectManager |
|
| 59 | + * @param Account $objectManager |
|
| 60 | 60 | */ |
| 61 | 61 | public function injectAccount(ObjectManager $objectManager) { |
| 62 | 62 | $this->objectManager = $objectManager; |
@@ -97,8 +97,8 @@ |
||
| 97 | 97 | $params = array('code' => $code, 'redirect_uri' => $this->getRedirectUri($this->account)); |
| 98 | 98 | $response = $this->OAuth->getAccessToken(self::TOKEN_ENDPOINT, 'authorization_code', $params); |
| 99 | 99 | |
| 100 | - if( $response ){ |
|
| 101 | - if( $response['code'] == 200 ){ |
|
| 100 | + if ($response) { |
|
| 101 | + if ($response['code'] == 200) { |
|
| 102 | 102 | $this->account->setAccessToken($response['result']['access_token']); |
| 103 | 103 | $this->persistenceManager->update($this->account); |
| 104 | 104 | $this->persistenceManager->persistAll(); |
@@ -115,9 +115,9 @@ |
||
| 115 | 115 | */ |
| 116 | 116 | public function authenticationResponseAction(Account $account) : void |
| 117 | 117 | { |
| 118 | - if( $this->client->callHubic($account) ){ |
|
| 118 | + if ($this->client->callHubic($account)) { |
|
| 119 | 119 | $this->addFlashMessage('Token successfully added', 'Authentication request', AbstractMessage::OK); |
| 120 | - }else { |
|
| 120 | + } else { |
|
| 121 | 121 | $this->addFlashMessage('Failed getting token please check client ID and client secret', 'Authentication request', AbstractMessage::ERROR); |
| 122 | 122 | } |
| 123 | 123 | $this->redirect('show', '', '', ['account' => $account]); |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | { |
| 118 | 118 | if( $this->client->callHubic($account) ){ |
| 119 | 119 | $this->addFlashMessage('Token successfully added', 'Authentication request', AbstractMessage::OK); |
| 120 | - }else { |
|
| 120 | + } else { |
|
| 121 | 121 | $this->addFlashMessage('Failed getting token please check client ID and client secret', 'Authentication request', AbstractMessage::ERROR); |
| 122 | 122 | } |
| 123 | 123 | $this->redirect('show', '', '', ['account' => $account]); |