awurth /
slim-rest-base
| 1 | <?php |
||||
| 2 | |||||
| 3 | namespace App\Controller; |
||||
| 4 | |||||
| 5 | use Awurth\Slim\Helper\Controller\RestController; |
||||
| 6 | use Chadicus\Slim\OAuth2\Http\RequestBridge; |
||||
| 7 | use Chadicus\Slim\OAuth2\Http\ResponseBridge; |
||||
| 8 | use Slim\Http\Request; |
||||
| 9 | use Slim\Http\Response; |
||||
| 10 | |||||
| 11 | class TokenController extends RestController |
||||
| 12 | { |
||||
| 13 | public function token(Request $request) |
||||
| 14 | { |
||||
| 15 | $oauthRequest = RequestBridge::toOAuth2($request); |
||||
| 16 | |||||
| 17 | $oauthResponse = $this->oauth->handleTokenRequest($oauthRequest); |
||||
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
Loading history...
|
|||||
| 18 | |||||
| 19 | return ResponseBridge::fromOauth2($oauthResponse); |
||||
| 20 | } |
||||
| 21 | |||||
| 22 | public function user(Request $request, Response $response) |
||||
|
0 ignored issues
–
show
The parameter
$request is not used and could be removed.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This check looks for parameters that have been defined for a function or method, but which are not used in the method body. Loading history...
|
|||||
| 23 | { |
||||
| 24 | return $this->ok($response, $this->sentinel->getUser()); |
||||
|
0 ignored issues
–
show
The property
sentinel does not exist on App\Controller\TokenController. Since you implemented __get, consider adding a @property annotation.
Loading history...
|
|||||
| 25 | } |
||||
| 26 | } |
||||
| 27 |