Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Lines | 12 |
Ratio | 100 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
57 | public function issueAccessToken() |
||
58 | { |
||
59 | try { |
||
60 | |||
61 | // Try to respond to the request |
||
62 | return $this->server->respondToAccessTokenRequest($this->request, $this->response)->getBody(); |
||
63 | } catch (OAuthServerException $exception) { |
||
64 | |||
65 | // All instances of OAuthServerException can be formatted into a HTTP response |
||
66 | return $exception->generateHttpResponse($this->response); |
||
67 | } |
||
68 | } |
||
69 | } |
||
70 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.