Skip to content

Commit f5fa868

Browse files
chore: Add PR requested changes
1 parent 5ce71f5 commit f5fa868

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

app/Http/Controllers/Api/OAuth2/OAuth2RocketChatSSOApiController.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<?php namespace App\Http\Controllers\Api\OAuth2;
1+
<?php
2+
namespace App\Http\Controllers\Api\OAuth2;
23
/**
34
* Copyright 2020 OpenStack Foundation
45
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -36,8 +37,7 @@ public function __construct
3637
IRocketChatSSOService $service,
3738
IResourceServerContext $resource_server_context,
3839
ILogService $log_service
39-
)
40-
{
40+
) {
4141
parent::__construct($resource_server_context, $log_service);
4242
$this->service = $service;
4343
}
@@ -66,6 +66,7 @@ public function __construct
6666
content: new OA\JsonContent(
6767
// The content of the response is defined by "data" portion of
6868
// the Rocket Chat login endpoint response structure
69+
red: '#/components/schemas/RocketChatUserProfile',
6970
)
7071
),
7172
new OA\Response(
@@ -86,21 +87,18 @@ public function __construct
8687
* @param string $forum_slug
8788
* @return \Illuminate\Http\JsonResponse|mixed
8889
*/
89-
public function getUserProfile(string $forum_slug){
90-
try{
90+
public function getUserProfile(string $forum_slug)
91+
{
92+
try {
9193
$profile = $this->service->getUserProfile($forum_slug);
9294
return $this->ok($profile->serialize());
93-
}
94-
catch (ValidationException $ex) {
95+
} catch (ValidationException $ex) {
9596
Log::warning($ex);
9697
return $this->error412([$ex->getMessage()]);
97-
}
98-
catch(EntityNotFoundException $ex)
99-
{
98+
} catch (EntityNotFoundException $ex) {
10099
Log::warning($ex);
101-
return $this->error404(['message'=> $ex->getMessage()]);
102-
}
103-
catch (\Exception $ex) {
100+
return $this->error404(['message' => $ex->getMessage()]);
101+
} catch (\Exception $ex) {
104102
Log::error($ex);
105103
return $this->error500($ex);
106104
}

0 commit comments

Comments
 (0)